Hi I am trying to create a stored procedure (SQL query) that returns all columns of a table but only want the rows that are DISTINCT for one column only. That is I have a column TESTINT with integers like 1,2,2,2,3,3,4,4,5,6,6,6,6 ect. I only want the first row for 1,2,3,4,5,6 and want all the columns in the tabe for these rows. I can use DISTINCT to only return the column TESTINT but need the data in the other columns as well. I tried a subquery but the subquery was returning more than 1 record.
↧