A Gentle Introduction to

SQL

NEW.

These questions have been submitted by users.



How can we locate the lowest date for each record when table has about 10 columns of dates?
We can "normalise" the data. We create a view of the table that has one date per row...
ID D1 D2 D3
1 20-MAY-61 21-MAY-61 19-MAY-61
2 20-MAY-62 19-MAY-62 21-MAY-62
Number of records: 2
Becomes this...
ID D V
1 d1 20-MAY-61
1 d2 21-MAY-61
1 d3 19-MAY-61
2 d1 20-MAY-62
2 d2 19-MAY-62
2 d3 21-MAY-62
Number of records: 6
oracle variations:
None

access
db2
mysql
oracle
postgres
sqlserver