View-merging means that selecting from a subquery may not yield the intended results. The issue is fascinating, and can be looked at from many perspectives.
One aspect of SQL that I've long enjoyed is the possibility of taking a feature of the language that doesn't seem to bear on the problem at hand, and applying that feature in some clever way to solve the problem. Here is a fun application of the technique I wrote about last year in Finding Flight Legs.
Pivot tables are incredibly useful when writing certain types of SQL queries, because they let you generate rows that do not otherwise exist. Here are several ways to create them. (There is also a CONNECT BY approach that is well-known on the Internet, but that I have never gone back and added to this article).
A few days ago, I wrote Does PL/SQL Implicitly Close Cursors in response to reader question about whether PL/SQL would implicitly close any open cursors at the end of a block. That same reader recently sent me a snippet of code that has caused me to rethink my position.
The key to getting accurate information from your database is to write good SELECT statements. In fact, it's the key to just about everything you do with your data. Even the tasks of updating and deleting data depend on your ability to select the relevant data in the first place. Because selecting the correct data is the foundation for much of what you do with your database, it's worth taking some time to think about how you write SELECT statements.