ADD_MONTHS ( dt, -12 )
- INTERVAL '1' YEAR
But take care - these handle 29th Feb differently:
ADD_MONTHS => 29th Feb -> 28th Feb in previous year
INTERVAL => 29th Feb -> 29th Feb in previous year => error!
ADD_MONTHS ( dt, -12 )
- INTERVAL '1' YEAR
But take care - these handle 29th Feb differently:
ADD_MONTHS => 29th Feb -> 28th Feb in previous year
INTERVAL => 29th Feb -> 29th Feb in previous year => error!
FETCH FIRST n ROWS ONLY
You can include all rows with the same sort value as the Nth with
FETCH FIRST n ROWS WITH TIES
Or get a fraction of the rows with
FETCH FIRST n PERCENT ROWS [ ONLY | WITH TIES ]
FETCH FIRST n ROWS ONLY
You can include all rows with the same sort value as the Nth with
FETCH FIRST n ROWS WITH TIES
Or get a fraction of the rows with
FETCH FIRST n PERCENT ROWS [ ONLY | WITH TIES ]
Numbers => numeric type
Datetimes => date/timestamp type
Using the wrong data type leads to implicit type conversions which can:
Prevent index use => slow SQL
Be invalid => runtime errors
Choose wisely!
Numbers => numeric type
Datetimes => date/timestamp type
Using the wrong data type leads to implicit type conversions which can:
Prevent index use => slow SQL
Be invalid => runtime errors
Choose wisely!