Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
sotian
Starting Member
8 Posts |
Posted - 2007-03-09 : 05:58:46
|
Hello,I have two tables, a header table, and child table.The child table contains a range of dates.In a stored procedure I want to return the header table, and separately the child table, but only the top 2 items relating to the header table.So:Select * From headerSelect top 2 * From Child order by childdateThis obviously only returns the top two child records instead of the top 2 per header record.Help would be appreciatedThanks,Jon |
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2007-03-09 : 06:20:42
|
http://weblogs.sqlteam.com/mladenp/archive/0001/01/01/7421.aspxpoint 2_____________________________Causing trouble since 1980blog: http://weblogs.sqlteam.com/mladenp |
 |
|
|
|
|