推 bobju:用 group by 對 city 做分群,having 做篩選, count做計算. 02/28 02:36
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: 111.240.94.63