Solved

How to select only the first match ?

Posted on 2004-04-15
3
567 Views
Last Modified: 2008-03-06
I have a table with loads of duplicates (not real ones, but like with a "-" in one and not in an other etc ...)

So, the comapy names are differents, but the phone number is the same.

I would like to create a querry that only take the first match for each phone number, and leave the other ones ... so i only have 1 company by phone number ...


Thanks
0
Comment
Question by:Sebuturn
3 Comments
 
LVL 2

Expert Comment

by:GDE
ID: 10830988
In oralce it`s be, for example,
select * from your_table where rownum<2

Best regards
Dmitry.
0
 

Author Comment

by:Sebuturn
ID: 10831013
Oh yeah .. i m using access
0
 
LVL 25

Accepted Solution

by:
lwadwell earned 70 total points
ID: 10831061
what do you really mean by 'first match'...if you did a 'group by phone_number' and select 'max(company_name)' or 'min(company_name)' you will get only one company by phone number...
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article describes some very basic things about SQL Server filegroups.
CCModeler offers a way to enter basic information like entities, attributes and relationships and export them as yEd or erviz diagram. It also can import existing Access or SQL Server tables with relationships.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

685 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