It's telling you that it doesn't know how to combine records so that only unique values of "nom" will appear. For example, if you had a table like
Code:
nom Field2 Field3
Code:
A 10 ABC
A 12 XXX
Oracle can't determine how to deal with different values of Field2 and Field3 while displaying only one value ("A" for nom.
You can have as many fields as you want in your GROUP BY
SELECT * from table group by nom, Field1, Field2
Note however that you are retrieving all ("*" fields from the table. You can of course GROUP BY all of them but that's the same as not grouping at all ... assuming that your table doesn't contain duplicate records.
The better question is probably "Why do you want to group records at all?" Are you trying to Count them? Sum them? Find Min or Max Values?
The title of your post is "Select Distinct". Do you just want to
SELECT DISTINCT * from table
(Again somewhat pointless since it will still display every record as long as you are retrieving all fields.)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.