Subject | Re: [firebird-support] Trouble with select |
---|---|
Author | Woody |
Post date | 2012-02-08T21:33:45Z |
From: "Leyne, Sean" <Sean@...>
of that. My bad. :(
Woody (TMW)
> Woody,Must be a language problem because it seems to me he was saying the opposite
>
>> > 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.
of that. My bad. :(
Woody (TMW)