Re: [SQL ] 某公司的試題

看板Database作者 (寶貝豬)時間15年前 (2011/02/28 02:40), 編輯推噓0(002)
留言2則, 2人參與, 最新討論串2/2 (看更多)
結構是這樣: select city,count(*) from Customer group by city having count(*) >= 6 ※ 引述《ami9897 (小新)》之銘言: : Below is the customer table in database ABC. : [Customer Table]: : ID Name Salary City : ==================================== : 1 Romeo 1000 Surabaya : 2 Julia 3000 Ho chi min : 3 Robert 2000 Hongkong : ? : 100 Deniro 5000 Singapore : (total record = 100) : (Id is Primary Key) : Please provide a SQL script to query customer that his/her city occurs in : the table more than or equal to 6. : Example: : The number of customer that live in hongkong is 10 : The number of customer that live in surabaya=5 : The number of customer that live in singapore=6. : So in this example the output should be all customer that live in : Singapore and Hongkong only. : 到現在小弟還想不出來 不知版上大大是不是有想法 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 115.43.11.116

03/01 21:48, , 1F
靠唄~~~怎麼那麼像某大學碩班的考古題(指答案)XD!!!
03/01 21:48, 1F

03/02 11:59, , 2F
這種答案,會的人大概都是這麼寫的.這題難度算低了. :(
03/02 11:59, 2F
文章代碼(AID): #1DQfgmKz (Database)
文章代碼(AID): #1DQfgmKz (Database)