Re: Finding non-duplicate records?
From: Vishal Parkar (REMOVE_THIS_vgparkar_at_yahoo.co.in)
Date: 06/16/04
- Previous message: Rohtash Kapoor: "Re: Finding non-duplicate records?"
- In reply to: Billz89: "Finding non-duplicate records?"
- Next in thread: Billz89: "Re: Finding non-duplicate records?"
- Reply: Billz89: "Re: Finding non-duplicate records?"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 16 Jun 2004 15:47:40 +0530
hi bill,
>>now I just need to pull the non-duplicate e-mails from the contest table<<
If i understand your requirement correctly, you can write a query as shown
in following example. Pls post the ddl, some sample records and expected
result set to explain your problem.
--sample data
create table contest(pkid int identity (1,1), email varchar(50))
insert into contest (email) values('vgparkar@yahoo.co.in')
insert into contest (email) values('vgparkar@yahoo.co.in')
insert into contest (email) values('vgparkar@hotmail.com')
insert into contest (email) values('vparkar@hotmail.com')
--query to get non duplicate email ids.
select a.pkid,a.email
from contest a join
(select email from contest group by email having count(*) = 1) b
on a.email = b.email
-- Vishal Parkar vgparkar@yahoo.co.in | vgparkar@hotmail.com
- Previous message: Rohtash Kapoor: "Re: Finding non-duplicate records?"
- In reply to: Billz89: "Finding non-duplicate records?"
- Next in thread: Billz89: "Re: Finding non-duplicate records?"
- Reply: Billz89: "Re: Finding non-duplicate records?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|