Re: SELECT in problem

From: Marconelli <mjk_at_NOSPAM.go2.pl>
Date: Thu, 4 Mar 2010 14:55:26 +0100
Message-ID: <hmoe9a$3ef$1_at_atlantis.news.neostrada.pl>


Uzytkownik "jefftyzzer" <jefftyzzer_at_sbcglobal.net> napisal w wiadomosci news:07c710d1-5277-4e8f-971f-4d5dfb7764aa_at_q21g2000yqm.googlegroups.com... 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
> 1
> 2
> 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

Original text of this message