| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: 3 value logic. Why is SQL so special?
Cimode wrote:
> 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
> be a second table for flights if you pretend your schema is normalized.
No I didn't mean a separate table - I meant within the same table. For example, in SQL Server the query to find the occurrences of flights with the same scheduled and actual date (if the table allowed NULLs) would be:
SELECT scheduled_date,
ISNULL(actual_date, '1 Jan 1900') AS actual_date,
COUNT(*) AS cnt
SELECT scheduled_date,
CONVERT(DATETIME, '1 Jan 1900') AS actual_date,
COUNT(*) AS cnt
FROM flight_actuals fa
WHERE fa.FlightID = f.FlightID)
GROUP BY scheduled_date
fa.actual_date,
COUNT(*) AS cnt
Chris Received on Sat Sep 16 2006 - 18:59:33 CDT
![]() |
![]() |