Transact SQL

TwitterFacebook
Get flash to fully experience Pearltrees
http://www.xaprb.com/blog/2006/12/07/how-to-select-the-firstleastmax-row-per-group-in-sql/

How to select the first/least/max row per group in SQL at Xaprb

Here are some common SQL problems, all of which have related solutions: how do I find the most recent log entry for each program?
http://www.orafaq.com/node/1879

The SQL WITH Clause, (Order Your Thoughts, Reuse Your Code)

So here I am writing even more documentation for my current Gig, and thinking once again, why not post it to OraFAQ and get double duty out of the document.
The CTE was introduced into standard SQL in order to simplify various classes of SQL Queries for which a derived table just wasn't suitable. For some reason, it can be difficult to grasp the techniques of using it. Well, that's before Rob Sheldon explained it all so clearly for us. https://www.simple-talk.com/sql/t-sql-programming/sql-server-cte-basics/

SQL Server CTE Basics