nowandever29
MIS
I need help with getting just one row of a subtable for each entry in the main table. For example, let's say I have:
Applications
============
AppID AppName
1 Open Office
2 Paint.Net
3 Firefox
Contacts
========
ConID AppID ContactName
1 1 Bill Forbes
2 1 Frank Jones
3 1 Bob Smith
When I do an outer join on these, I get three rows for App #1, as expected, each with a different contact name. But now I have the need to create a view that shows just one row per application, and includes (any one) of the contacts for that application.
I've yet to find how to do this - in Access, you can use FIRST(), but T-SQL (2008) doesn't have that. Can anyone help? I tried the blog at but it was related to numerical values, and did not help.
Applications
============
AppID AppName
1 Open Office
2 Paint.Net
3 Firefox
Contacts
========
ConID AppID ContactName
1 1 Bill Forbes
2 1 Frank Jones
3 1 Bob Smith
When I do an outer join on these, I get three rows for App #1, as expected, each with a different contact name. But now I have the need to create a view that shows just one row per application, and includes (any one) of the contacts for that application.
I've yet to find how to do this - in Access, you can use FIRST(), but T-SQL (2008) doesn't have that. Can anyone help? I tried the blog at but it was related to numerical values, and did not help.