Solved

How to select only the first match ?

Posted on 2004-04-15
3
563 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

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.
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
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…

896 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now