Problem with this question is what to do with FIELD2, FIELD3, etc. Getting DISTINCT value for FIELD1 is trivial, but when FIELD1 is the same across multiple records, and you specify you want the other fields as well, but they are not the same across multiple records, what should be returned?
Analagous to asking for phone book to give you distinct last names (only one SMITH) but also return address and phone number fileds. Well, which SMITH's phone number should be included? And more importantly, what does it mean?
bborissov has the correct SQL syntax. I reproduced it for myself just now and will inlcude if you want to play with it, but real issue is one of meaning, given distinct FIELD1 what does FIELD2 etc. mean in this context?
USE Sandbox
CREATE TABLE MYTEST
(FIELD1 INT, FIELD2 INT)
INSERT INTO MYTEST VALUES (1,1)
INSERT INTO MYTEST VALUES (1,1)
INSERT INTO MYTEST VALUES (1,2)
INSERT INTO MYTEST VALUES (2,2)
INSERT INTO MYTEST VALUES (3,3)
SELECT * FROM MYTEST
SELECT DISTINCT(FIELD1), FIELD2
FROM MYTEST
--1,1
--1,2
--2,2
--3,3
SELECT FIELD1,FIELD2
FROM MYTEST
GROUP BY FIELD1,FIELD2
--1,1
--1,2
--2,2
--3,3
SELECT FIELD1, MAX(FIELD2) AS FIELD2
FROM MYTEST
GROUP BY FIELD1
--1,2
--2,2
--3,3
--Note GROUP BY only on Field1 OK because
--Field 2 in Aggregate