Thursday, June 13, 2013

nested select ! & how to select duplicated rows !

create table tble1
(name nvarchar(max),age int , adress nvarchar(max))

insert into tble1 values ('george ostaaz',23,'tanta')
insert into tble1 values('mina',24,'tanta')
insert into tble1 values ('george beh',23,'tanta')
insert into tble1 values ('george basha ',23,'alex')

select * from tble1

select * from tble1 where adress in (
select adress from tble1 group by adress having COUNT (*)>1)

kda nested select w select duplicated rows ;) etnen feh wa7ed ! :D

No comments:

Post a Comment