There's a gap in my SQL knowledge I'd like to fill and I'm after recommendations on where to find resources, eg. websites, how-tos, books, etc.
I've been using SQL databases for a long time. I'm quite comfortable with: basic SQL and its syntax; creating tables and indexes; inserting data; and basic DBMS maintanenance.
Where I struggle is getting the data out for anything beyond basic SELECT statements. I've recently got my head around some basic INNER JOINs and GROUP BY so I can use commands like SUM and MAX. But the "SQL way", ie. set logic, eludes me. Is there a solid overview of this stuff so I can properly understand set logic, JOINs (all types), nested SELECTs, WITH, CROSS APPLY, ROW_NUMBER(), etc.
I've found a couple of good questions on SO (here and here). But the answers are a bit too general. I don't want a beginners guide to SQL or databases. I get that. I'm after stuff on the relatively narrow topic of smart queries. Vendor-agnostic stuff would be preferable. Many thanks.
In summary, my question is: can you recommend some good resources (online or print) to help me learn how to take my SQL queries beyond the basic level. That is, something other than introductory/basic texts. As I said, I'm comfortable with the basics, I need intermediate to advanced coverage of SQL queries.
UPDATE 2009-10-12 re Selected Answer: A wide variety of answers, mostly recommending books, rather than online resources, which was a bit of a surprise to me. Many authors were recommended (here and in other SO questions). The two most popular were Chris Date and Joe Celko. It was difficult to pick not having read either. What settled it in the end was DBA friend had a copy of SQL for Smarties I could borrow, but nothing from Date.