dbTalk Databases Forums  

Re: Select Distinct for 1 Column

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Re: Select Distinct for 1 Column in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Sue Hoegemeier
 
Posts: n/a

Default Re: Select Distinct for 1 Column - 06-15-2006 , 02:12 PM






It's a bit hard to help with a query when the only
information you have to go on is:
SELECT a, email, b, c, d, e, f, g, h, i, j FROM x JOIN y on
a = b JOIN Z on
a = b WHERE x.sendemail = true ORDER BY email
It shouldn't be too hard but you will need to post the DDL,
sample data, etc so others can help you out with it.

Other than that, try looking up DISTINCT in books online -
maybe you can figure it out from there.

-Sue

On Thu, 15 Jun 2006 10:46:01 -0700, PokerJoker
<PokerJoker (AT) discussions (DOT) microsoft.com> wrote:

Quote:
nobody?

"PokerJoker" wrote:

I'm pulling a list of customers from out database for a mailing list... it
has to keep a specific format to work with the mailing program that we use.
Problem is, many of our users have the same email address if they work
together at a small company. The emailer we user doesn't filter for that, so
I'd like to account for it in the DTS.

My query currently looks like this...

SELECT a, email, b, c, d, e, f, g, h, i, j FROM x JOIN y on a = b JOIN Z on
a = b WHERE x.sendemail = true ORDER BY email

thanks in advance


Reply With Quote
  #2  
Old   
dh
 
Posts: n/a

Default Re: Select Distinct for 1 Column - 06-15-2006 , 10:06 PM






"PokerJoker" <PokerJoker (AT) discussions (DOT) microsoft.com> wrote

Quote:
nobody?

"PokerJoker" wrote:

I'm pulling a list of customers from out database for a mailing list...
it
has to keep a specific format to work with the mailing program that we
use.
Problem is, many of our users have the same email address if they work
together at a small company. The emailer we user doesn't filter for
that, so
I'd like to account for it in the DTS.

My query currently looks like this...

SELECT a, email, b, c, d, e, f, g, h, i, j FROM x JOIN y on a = b JOIN
Z on
a = b WHERE x.sendemail = true ORDER BY email

thanks in advance
It would help to know what the keys are on the various tables involved and
whether or not you want to send one or multiple e-mails to a shared e-mail
address, with different "dear so-and-so" entries on each (I suspect one
e-mail per e-mail address but it's not 100% clear).

Your problem could be solved variously by GROUP BY based on the e-mail
address with some hack-y MAX functions or something or a subselect or a
HAVING clause, perhaps, depending on exactly what you want to do.



--
Posted via a free Usenet account from http://www.teranews.com



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.