Solved

Simple SQL Code

Posted on 2014-01-30
3
263 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
  • 2
3 Comments
 
LVL 76

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Article by: Swadhin
From the Oracle SQL Reference (http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/queries006.htm) we are told that a join is a query that combines rows from two or more tables, views, or materialized views. This article provides a glimps…
Note: this article covers simple compression. Oracle introduced in version 11g release 2 a new feature called Advanced Compression which is not covered here. General principle of Oracle compression Oracle compression is a way of reducing the d…
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 videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

759 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

19 Experts available now in Live!

Get 1:1 Help Now