?
Solved

Simple SQL Code

Posted on 2014-01-30
3
Medium Priority
?
273 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 1000 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

Veeam Task Manager for Hyper-V

Task Manager for Hyper-V provides critical information that allows you to monitor Hyper-V performance by displaying real-time views of CPU and memory at the individual VM-level, so you can quickly identify which VMs are using host resources.

Question has a verified solution.

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

I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that use…
This post first appeared at Oracleinaction  (http://oracleinaction.com/undo-and-redo-in-oracle/)by Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.
Suggested Courses

764 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