[Solved] Selecting a Single Record for Each Type [closed]


Try

SELECT DISTINCT [Vehicle Type] FROM your_table

I see your edits. This query gives you exactly what you ask:

WITH t1 AS
(
  SELECT
    ID, Model, [Vehicle Type], Owner,
    RANK() OVER(PARTITION BY [Vehicle Type] order by ID) AS t2
  FROM your_table
)  
SELECT ID, Model, [Vehicle Type], Owner
FROM t1
WHERE t2 = 1

Check it here

8

solved Selecting a Single Record for Each Type [closed]