Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

quick SQL question - the missing ID

843859Oct 28 2005 — edited Oct 28 2005
Hi guys,

quick question:

SELECT ID, COUNT(ID)+1 AS numFamily FROM tableA Group By ID

the result for this query will be somthing like:

105 4
106 8
107 3
109 4

the problem is (and this is my question) what if ID=108 is not mention in this table (it exist but in a different table) how can I get a result where:

105 4
106 8
107 3
108 1 //<-- added this (the num one is there becuase I COUNT(ID)+1 )
109 4


thanks for any help
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 25 2005
Added on Oct 28 2005
3 comments
120 views