I have a dynamic table (from subquery):
col1 | col2
-----------
14 | 1000
14 | 2000
14 | 3000
15 | 1000
15 | 2000
I want to group result by col1, but with distinct col2 value:
col1 | col2
-----------
14 | 1000
15 | 2000
Is it possible?
additional info :
请尝试以下一项:
select DISTINCT(col2), col1 from tablename group by col1
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.