Re: SELECT in problem
Date: Thu, 4 Mar 2010 14:55:26 +0100
Uzytkownik "jefftyzzer" <jefftyzzer_at_sbcglobal.net> napisal w wiadomosci
On Mar 3, 5:45 am, Pedro <pedro.p..._at_gmail.com> wrote:
> Good morning people. I need quiet an odd help in here. Let me see if I
> can explain it.
> I have an SELECT WHERE IN (<list of ids>).
> Let us say that I sent the following list of ids: 1, 2 and 3.
> There is only resulting records for the ID = 3, but I'd like to see
> all the ids, even if they don't have records...
> I expect the following result for instance:
> ID DESC
> 3 Test
> Any suggestion on how to do this? I have here the complete statement,
> but I don't think it would help for now...
Here's a little nicer version:
WITH counter AS (SELECT level id FROM dual CONNECT BY level <=3)
SELECT c.id, t.*
FROM counter c
LEFT OUTER JOIN table t ON c.id = t.id Received on Thu Mar 04 2010 - 07:55:26 CST