如何去掉表中某一列有重复的数据,只保留一条
creat table A
(
id int,
Name varchar(50)
)
insert into a
select 1,'qw1'
union all select 2,'qw1'
union all select 3,'qw2'要变成
1 qw1
3 qw2
或是
2 qw1
3 qw2
creat table A
(
id int,
Name varchar(50)
)
insert into a
select 1,'qw1'
union all select 2,'qw1'
union all select 3,'qw2'要变成
1 qw1
3 qw2
或是
2 qw1
3 qw2
Select * from A where name=x.name and ID>x.ID)
FROM STAFF
WHERE DEPT < 30
ORDER BY DEPT, JOB此语句产生下列结果: DEPT JOB
------ -----
10 Mgr
15 Clerk
15 Mgr
15 Sales
20 Clerk
20 Mgr
20 SalesDISTINCT 已消除了在 SELECT 语句中指定的一组列中所有包含重复数据的行。
WangZWang(先来) ( ) 信誉:100
delete x from A as x where exists(
Select * from A where name=x.name and ID>x.ID)编译错误
请对你的回答负责一点
Select * from A where name=x.name and ID>x.ID)
--经测试是正确的,你哪儿有编译错误?
delete from A
WHERE 条件
对不起,我不小心输了个',',分已给你了,