You can use one or the other of the queries shown below. These will work only on SQL 2005 or higher: -- 1
SELECT
b.*
FROM
YourTable a
CROSS APPLY
(
SELECT TOP 1 *
FROM YourTable b
WHERE b.Catid = a.CatId
ORDER BY col1,col2 -- columns you want to use to determine which one to pick
) b
-- 2
SELECT
a.Col1,
a.Col2,
a.CatID
FROM
(
SELECT b.*,
ROW_NUMBER() OVER
(
PARTITION BY b.catid
ORDER BY col1, col2 -- columns you want to use to determine which one to pick
) RN
FROM YourTable b
) a
WHERE a.RN = 1;