quick SQL question - the missing ID
843859Oct 28 2005 — edited Oct 28 2005Hi 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