Query to return First occurrence.

  • Thread starter Thread starter Rog
  • Start date Start date
R

Rog

Hello
How would I create a query to return only the first
occurrence of a field. In my case I have a field for a
username. I only want the query to return the username one
time instead of listing every instance of it. thanks in
advance.
 
select top 1 username, whatever, whatever2 from UsernameTable;
or
select distinct username from UsernameTable;

Regards, Sandy
 
Either turn on Totals and make your field 'Group By' or
select 'Top Values' and input 1.
-Cameron Sutherland
 
Back
Top