Need help with MS SQL Select Distinct Query - multiple columns
I have the query below:
select distinct column0, id
from all_codes
group by id,column0
The ID field is an auto increment field and is necessary to keep the codes in cloumn0 in a specific order.
If I run this query it does not select unique records from Column0, but returns all records. (There are about 20,000 duplicates in column0 out of total 1 million records)
I need to return only unique records in column0 but keep the sort on the ID field.
There are many ways to learn to code these days. From coding bootcamps like Flatiron School to online courses to totally free beginner resources. The best way to learn to code depends on many factors, but the most important one is you. See what course is best for you.
Open in new window