Re: 3 value logic. Why is SQL so special?
From: Chris Lim <blackcap80_at_hotmail.com>
Date: 16 Sep 2006 17:21:17 -0700
Message-ID: <1158452477.694390.312970_at_k70g2000cwa.googlegroups.com>
FROM Customer
GROUP BY last_name,
HAVING COUNT(*) > 1 What would be the equivalent in the no NULLs database?
Date: 16 Sep 2006 17:21:17 -0700
Message-ID: <1158452477.694390.312970_at_k70g2000cwa.googlegroups.com>
Cimode wrote:
> You should not be surprised. SQL is not a relational language for a
> long time. SQL is by nature a redundant language. Additionally, your
> second example is a bad one two. At the first place, there should not
And if I needed a query to identify customers with the same last name + middle name + birth_date + gender, what would the query look like for that? If they were NULLable columns in the same table, it would be something like:
SELECT last_name,
ISNULL(middle_name, '') AS middle_name,
ISNULL(birth_date, '1 Jan 2050') AS birth_date,
ISNULL(gender, '') AS gender,
COUNT(*) AS cnt
FROM Customer
GROUP BY last_name,
ISNULL(middle_name, ''),
ISNULL(birth_date, '1 Jan 2050'),
ISNULL(gender, '')
HAVING COUNT(*) > 1 What would be the equivalent in the no NULLs database?
Chris Received on Sun Sep 17 2006 - 02:21:17 CEST
