A表中有 字段 a, b,c。现在要判断a字段的值不能重复、、求sql语句
A表中有 字段 a, b,c。现在要判断a字段的值不能重复、、求sql语句
日期:2013-11-14 10:16:45 人气:1
查找a不重复的数据
select a,b,c from 表
where a not in
(
select a from 表
group by a
having count(a) > 1
)
查找a重复的数据
select a from 表
group by a
having count(a) > 1