List:General Discussion« Previous MessageNext Message »
From:Hal Vaughan Date:September 29 2005 3:40pm
Subject:Limiting "DISTINCT" To One Column
View as plain text  
I have a query like this:

SELECT DISTINCT Channel, ChannelType, Source FROM ChannelStatus;

Each channel is supposedly listed in this table only 1 time, but just in case, 
what I really want to do is make sure that no channels are duplicated.  Is 
there some way to make the keyword "DISTINCT" apply to Channel only?  Sort of 
a shortcut to (example in pseudocode, although it'd be in Perl):

SELECT DISTINCT Channel FROM ChannelStatus;
FOR EACH Channel
	SELECT Channel, ChannelType FROM Source WHERE Channel = 'channel'


Limiting "DISTINCT" To One ColumnHal Vaughan29 Sep
  • Re: Limiting "DISTINCT" To One ColumnHank29 Sep