SQL
zoo.net
Select a record with the latest date
SQLite
DB2
Ingres
Access
Postgres
Oracle
SQL Server
MySQL
Mimer
Sybase
SQL Server
There may be several records with the same date.
There are two steps...
(a) Find the latest date
(b) Select records with that date
With a nested select we can do both of these in one go.
SELECT * FROM totp where wk= (SELECT MAX(wk) FROM totp)
Specific to SQL Server
none
Related links:
DATES
Date and time types.
Format a date and time.
Specify a date (date literal).
Match a range of dates
Subtract dates.
Add days to a date. INTERVALS. Also subtract, also years, months, hours ...
Components of a date: such as the year or the month
Group by day of the week (using date functions)
Group by day of the week (using arithmetic)
How can I select the oldest person in the table PERSON by birthday?
Select a record with the latest date
How to format a date like yyyymmdd
How can I get the Lastest record from SQL