From: "Leyne, Sean" <[email protected]>
> Woody,
>
>> > Im trying a bit difficult select:
>> >
>> > select id, value
>> > from MyTable
>> > where id in (1, 1, 1, 2, 3, 3, 4)
>> >
>>
>> Try:
>>
>>     select DISTINCT id, value
>>     from MyTable
>>     where id in (1, 1, 1, 2, 3, 3, 4)
>
> You have misunderstood the Ops question.  That would give him the exact 
> same result he is seeing now.
>
> He wants 1 row for each IN () list item, including duplicates -- which 
> runs against conventional logic.
>
> The only solution I can see is a UNION ALL, but that would be a very ugly 
> SQL.

Must be a language problem because it seems to me he was saying the opposite 
of that. My bad. :(

Woody (TMW) 

Reply via email to