How to create fast database queries

Archive for March 5th, 2009

Row sampling

with 2 comments

Sometimes we need to get a sample row from a table satisfying a certain condition. Like, get a first row for each month.

MS SQL and Oracle supply analytical function ROW_NUMBER() for this purpose.

Let's create a simple table to illustrate our needs and see how do we query it.
Read the rest of this entry »

Written by Quassnoi

March 5th, 2009 at 9:00 pm

Posted in MySQL