[thelist] SQL question

noah noah at tookish.net
Fri Feb 28 00:02:01 CST 2003

Hi Ken,

Thanks for your help.

At 12:21 AM 28/02/2003, you wrote:
>If a.CertType is not required, then what rows from Certtypes do you want to
>return when a.CertType is not set?

Nothing from the CertTypes table, but I still want to return all the
records from the Gem table. The problem is that as soon as I introduce the
join between the Gem table and the CertTypes table, the query stops
returning all records in the Gem table where the CertType field is unset
(i.e., the field that I'm joining to the CertTypes table).

>Perhaps if you could give us some sample data (a few rows from each table),
>plus what you want the expected output to be, we can help you write the

Thanks -- it's actually quite convoluted, and I'm afraid that might further
confuse the issue (I simplified it significantly in asking my question). I
think the above explanation is better than my original one -- if not, let
me know and I'll put together the data.

Here's the query again:

>: SELECT * FROM Gem a, Shapes b, CertTypes c WHERE a.Shape = b.Shape AND
>: a.CertType = c.CertType AND NumberOfStones > 0 ORDER BY AverageSize

Thanks again,

More information about the thelist mailing list