I’m seeing people do this all the time. They want to hammer a date or timestamp constant into their SQL query, and the only function they know is the TO_DATE() or TO_TIMESTAMP() date parsing function: As observed in this Stack Overflow question, for instance: Date parsing is important only if your date input is really … Continue reading Don’t Format…
#date
3 posts
15 Sept 2015
25 Feb 2015
The Modern SQL Twitter account (by Markus Winand) published a hint about how to extract a date part in SQL: The right way to get a part of a date/time is: EXTRACT(YEAR FROM CURRENT_DATE) = 2015http://t.co/UNLyUoQdVb Retweet to spread the word! — Modern SQL (@ModernSQL) February 24, 2015 Is it true? Yes it is, in … Continue reading How to…
22 Dec 2014
We all know that Oracle’s DATE is not really a date as in the SQL standard, or as in all the other databases, or as in java.sql.Date. Oracle’s DATE type is really a TIMESTAMP(0), i.e. a timestamp with a fractional second precision of zero. Most legacy databases actually use DATE precisely for that, to store … Continue reading Are You…