Solved

Simple SQL Code

Posted on 2014-01-30
3
268 Views
Last Modified: 2014-01-30
I've got two tables.  One ID's has and id the other, names, has id plus first_name and last_name.  Names has five rows all of which match on id.  When i do something like:
select ID.id, names.first, names.last from ID, name where ID.id=names.id;
I want only a single match to be returned, not five rows.
0
Comment
Question by:xoxomos
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 77

Accepted Solution

by:
slightwv (䄆 Netminder) earned 250 total points
ID: 39822270
select ID.id, names.first, names.last from ID, name where ID.id=names.id and rownum=1;

Do you want a specific one or just any one?
0
 

Author Comment

by:xoxomos
ID: 39822290
I think they want any one at this point :-) thanks
0
 

Author Closing Comment

by:xoxomos
ID: 39822304
Perfect
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
When it comes to protecting Oracle Database servers and systems, there are a ton of myths out there. Here are the most common.
Via a live example show how to connect to RMAN, make basic configuration settings changes and then take a backup of a demo database
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.

697 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