SQL getting first full row matching each result in subquery
04:54 12 Jul 2012

I have a table with n columns of data, but I want to list one row for each unique set of 3 columns.

ID | data1 | data2 | data3 | description | price | handler | creationTime | ...

I'm trying to use this subquery:

SELECT distinct data1, data2, data3
FROM Table_1

... to get each unique variation for the 3 columns. But then I want to select ONE full row from the table for each such result.

How do I get the first full row matching each result in the subquery, optimized for rather heavy use, without table variables or while loops?

sql subquery