Subject Re: [firebird-support] Trouble with select
Author Helen Borrie
At 04:46 AM 9/02/2012, raistware wrote:
>Hi
>
>Im trying a bit difficult select:
>
>select id, value
>from MyTable
>where id in (1, 1, 1, 2, 3, 3, 4)
>
>I want that fore every value inside IN a row is output, so for example this would result something like:
>1 | 40
>1 | 40
>1 | 40
>2 | 21
>3 | 23
>3 | 23
>4 | 87
>
>But now I don't take duplicates, result is
>1 | 40
>2 | 21
>3 | 23
>4 | 87

Which is a correct result. The IN() predicate resolves to a series of ORs so, logically, it is the only possible result.


>Can someone help me to create that tricky select?

Why not just

where id between 1 and 4
?

./heLen