vendredi 8 mai 2015

How do I select a given number of rows for one table for each parent primary key in another table in sql server 2012?

I have two tables in sql. One is a table of test cases and the other is a table of test runs with a foreign key that links back to a test case. I want to get the most recent 10 test runs for each test case. I don't want to loop through if I don't have to, but I don't see any other way to solve this problem. What is the most effective way to handle this sort of thing in sql server?

Aucun commentaire:

Enregistrer un commentaire