Solved

How to select only the first match ?

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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

In today’s complex data management environments, it is not unusual for UNIX servers to be dedicated to a particular department, purpose, or database.  As a result, a SAS® data analyst often works with multiple servers, each with its own data storage…
APEX (Application Express) is used to develop a web application from Oracle. SQL Workshop is one of the tools that comes with Oracle APEX to query or modify the database objects or to make any changes to the structure.
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…

706 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

15 Experts available now in Live!

Get 1:1 Help Now