N
Nathan
Hi,
I'm using an oledb adapter to connect to Access. I need to select three
columns from a database and load them to a dataset: Name, Number, and
Category. Name and Number are unique for each record, but many records can
have the same Category. But I want to do a SELECT DISTINCT for only the
Name, but get the Number and Category as well. I first had only the first
two columns, and this worked fine:
SELECT DISTINCT Name, Number FROM DatabaseTable ORDER BY Name
This works because the Name and Number are unique for each record. But now
I have added Category to the table; how do I add it to the selection query?
SELECT DISTINCT Name, Number, Category FROM DatabaseTable ORDER BY Name
brings an error.
Thanks for your help.
Nathan
I'm using an oledb adapter to connect to Access. I need to select three
columns from a database and load them to a dataset: Name, Number, and
Category. Name and Number are unique for each record, but many records can
have the same Category. But I want to do a SELECT DISTINCT for only the
Name, but get the Number and Category as well. I first had only the first
two columns, and this worked fine:
SELECT DISTINCT Name, Number FROM DatabaseTable ORDER BY Name
This works because the Name and Number are unique for each record. But now
I have added Category to the table; how do I add it to the selection query?
SELECT DISTINCT Name, Number, Category FROM DatabaseTable ORDER BY Name
brings an error.
Thanks for your help.
Nathan