Specify a date

From SQLZOO
Revision as of 14:32, 17 July 2012 by Marek (Talk | contribs) (Created page with "Specify a date (a date literal). <div class='ht'> <div class=params>schema:gisq</div> <div> The Standard specifies a [http://sqlzoo.net/sql92.html#date_literal date literal] a...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Specify a date (a date literal).

schema:gisq

The Standard specifies a date literal as: DATE '1982-05-20'

Similarly specify a timestamp using TIMESTAMP '1982-05-20 21:30:00'

Find the songs played on 20th May 1982.

 
 
SELECT * FROM totp
 WHERE wk = DATE '1982-05-20'
SELECT * FROM totp
 WHERE wk = '1982-05-20'
SELECT * FROM totp
 WHERE wk = #20 May 1982#