Re: Finding non-duplicate records?
From: Billz89 (Billz89_at_discussions.microsoft.com)
Date: 06/17/04
- Next message: schmidtk: "using a variable for a @TO parameter in xp_stmp_sendmail"
- Previous message: bob: "Web Deploy Error"
- In reply to: Vishal Parkar: "Re: Finding non-duplicate records?"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 17 Jun 2004 08:36:03 -0700
I believe what I posted in reply to Rohtash Kapoor's e-mail has worked:
SELECT *
FROM Contest
WHERE (EMAIL NOT IN
(SELECT Email
FROM NewsLetter.dbo.pgd_Members))
I just had to delete all the duplicate records from the Contest table. Thanks.
"Vishal Parkar" wrote:
> 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
>
>
>
- Next message: schmidtk: "using a variable for a @TO parameter in xp_stmp_sendmail"
- Previous message: bob: "Web Deploy Error"
- In reply to: Vishal Parkar: "Re: Finding non-duplicate records?"
- Messages sorted by: [ date ] [ thread ]