Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

ACCESS

Posted on 2014-12-09
5
Medium Priority
?
202 Views
Last Modified: 2014-12-10
How to find Unique Records in ACCESS
0
Comment
Question by:lux sat
  • 2
  • 2
5 Comments
 
LVL 49

Expert Comment

by:Dale Fye
ID: 40490379
A little more detail would be helpful?  This isn't a homework assignment, is it?

Are you trying to identify only those records in a table which are unique for one or more fields, or are you simply trying to return a set of records with unique values.  If the latter, you can use the DISTINCT predicate in your SELECT statement:

SELECT DISTINCT Field1, Field2 FROM your Table

Or you might want to use a GROUP By clause:

SELECT Field1, Field2 FROM yourTable GROUP By Field1, Field2
0
 

Author Comment

by:lux sat
ID: 40490388
No it is not hw. but I am new to ACCESS. I need to eliminate Identical rows

Ex.

1  2 3
1 2  3
3 4 5

i just want my result set as
1 2 3
3 4 5
0
 
LVL 85
ID: 40490957
As Dale mentioned, more detail is helpful.

Are those values in the SAME field, or in DIFFERENT fields? How you go about showing distinct records depends greatly on that.

Also, you mention you want to "eliminate" identical rows. Does that mean you want to remove them, or just not show them in your query?

Note that Access includes a "Find Duplicates Query Wizard" which may be helpful. to use that, click the Create tab, and select "Query Wizard". You'll see the Duplicates Query in that list. Select that, and follow the prompts.
0
 

Author Comment

by:lux sat
ID: 40491453
Dale/Scott
I have attached the sample table as an image. I want to eliminate Row 3 ( 2 A B C).

ROW 1 is the fieldnames in my table.
TABLEIMAGE.JPG
Thanks,
LAKSHMI
0
 
LVL 49

Accepted Solution

by:
Dale Fye earned 2000 total points
ID: 40491564
Either of the methods I described above (using DISTINCT) or using a GROUP BY Clause will return a recordset that only has one result for A,B, C.  However, if you want to keep Field1 in the query, and that field is a unique value, it will force all rows to be returned with DISTINCT.  However, you might try:

SELECT MIN(Field1) as FirstOccurance, Field2, Field3, Field4
FROM yourTable
GROUP BY Field2, Field3, Field4
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
Microsoft Access has a limit of 255 columns in a single table; SQL Server allows tables with over 255 columns, but reading that data is not necessarily simple.  The final solution for this task involved creating a custom text parser and then reading…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

783 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question