Finding the Last Transaction for a Customer
January 31, 2007 Hey, Howard
I’ve been studying your book, SQL at Work. I was hoping you would answer a question for me. We have a historical transaction file sorted on a descending date field. I’d like to only select the latest record for a specific ID with the most current date. I don’t know the value of this date and I don’t want it to return any other records. Is this possible? Thanks! –Mary This kind of query can be done using a subquery or a join operation. Let’s create a sample table, load it with data, and try a few queries that |