MySQL

Get Last Record In Each MySQL Group

In this tutorial we will look at how you can use MySQL at getting the last record in a Group By of records. For example if you have this result set of posts. id category_id post_title ------------...

Update Row With Highest ID In MySQL

Recently needed to update the last inserted row of a table but didn't have anyway in knowing what the highest ID in the table was. I can easily do this by using the max() function to select the highes...

Maintaining Order With MySQL IN Operator

A basic tip in MySQL when you have to make multiple calls to the same table with a number of different ID's is to use the IN operator. If you had a list of ID's which you want to get the record for in...