• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 283
  • Last Modified:

Simple SQL Code

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
xoxomos
Asked:
xoxomos
  • 2
1 Solution
 
slightwv (䄆 Netminder) Commented:
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
 
xoxomosAuthor Commented:
I think they want any one at this point :-) thanks
0
 
xoxomosAuthor Commented:
Perfect
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now