Query to return First occurrence.

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.
 
S

Sandy Eastman

select top 1 username, whatever, whatever2 from UsernameTable;
or
select distinct username from UsernameTable;

Regards, Sandy
 
C

Cameron Sutherland

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

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

Top