select count(名字),名字 from table_name where XX group by 名字 having count(名字)>1;
你想问 啥子哦??一个表中可以有多个相同名称的列吗?要查列名到系统表里找
select a.name from syscolumns a ,sysobjects b where b.name ='a ' and a.id=b.id and a.name='。。。。'
select top 1 * from [表名] where [条件]
top 1的意思是返回多行数据中的第一行数据
select name,count(*) as count1 from table1 group by name having count(*) > 1
select name,count(*) from table group by name having count(*)>1