On Tue, 15 Jun 2004 09:28:42 +0200, Hugo Kornelis
[quoted text, click to view] <hugo@pe_NO_rFact.in_SPAM_fo> wrote:
>On Mon, 14 Jun 2004 23:46:42 GMT, dgk wrote:
>
>>I would like to retrieve distinct customer IDs where the customer has
>>at least one record that meets the condition of FieldX <> "Y". I have
>>this: "SELECT distinct CustID FROM Orders order by CustID" but this
>>just gets the list of all customer IDs. (There is no need for an
>>actual customer table).
>>
>>I could just grab all the records that fit the criteria of FieldX<>"Y"
>>and pull unique CustIDs programatically, but I think it is really a
>>job for SQLServer and not me. Thanks.
>
>Hi dgk,
>
>SELECT DISTINCT CustID
>FROM Orders
>WHERE FieldX <> 'Y'
>
>
>Best, Hugo