select distinct 字段1,字段2 from table1 where...
这样查询table1中字段1,字段2不重复的记录,注意的是distinct只能放在所有字段的最前面,不能
select 字段1,distinct 字段2 from talbe1 where...。
但如果是
select distinct * from table1 where...
这样只有有一个字段不同,就会分不同行的记录显示。
select distinct 字段1,字段2 from table1 where...
这样查询table1中字段1,字段2不重复的记录,注意的是distinct只能放在所有字段的最前面,不能
select 字段1,distinct 字段2 from talbe1 where...。
但如果是
select distinct * from table1 where...
这样只有有一个字段不同,就会分不同行的记录显示。
1513

被折叠的 条评论
为什么被折叠?
