distinct and distinctrow difference?

  • Thread starter Thread starter Tom
  • Start date Start date
DISTINCT de-duplicates the query results based on only the fields you return
(i.e. those in the SELECT clause.) For example:
SELECT DISTINCT City FROM tblClient;
returns each city just one, regardless of how many clients are in each city.

DISTINCTROW de-duplicates based on ALL the fields. If your table has a
primary key, and the query is based on just this one table, then DISTINCTROW
makes no difference, since the primary key guarantees uniqueness.

Well, that's how it's supposed to work anyway.
In practice, Access gets DISTINCT wrong sometimes:
http://allenbrowne.com/bug-12.html
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top