Topic: A bit disappointed
I found a book called SQL Hacks. It's from Oreilly ( http://www.oreilly.com/catalog/sqlhks/ ).
I like them a lot. I always find the content of their books very good, complete and useful.
Still.. Nobody can be perfect. Oreilly isn't !
One can download a sample of the book. Chapter 4 in this case. Date Handling.
What is wrong with this chapter (hence with the book).
1. They choosed as reference MySQL. Some people like it some don't. I would have chosen PostgreSQL as it's the closest open source replacement to Oracle.
2. At the very beginning of the chapter they talk about inserting dates in a database.
They say good things about TO_DATE used in Oracle. That allows one to specify the date format used.
Ex: INSERT INTO d VALUES (TO_DATE('1 Jun 2006', 'dd Mon yyyy'))
They say MySQL also has such a feature called STR_TO_DATE.
But they do not mention PostgreSQL also has a function called to_date that does the same as Oracle's function.
PostgreSQL 7.1 already had this function.
Today's version is 8.0 / 8.1.
Quote of the book:
"For most of the hacks in this chapter, we used MySQL as the base example and we've shown the variations for SQL Server, Access, Oracle and PostgreSQL."
Well they haven't.
/me is disappointed.