Home » SQL & PL/SQL » SQL & PL/SQL » Select from 2 tables
Select from 2 tables [message #698] Wed, 27 February 2002 06:21 Go to next message
Dan Goscomb
Messages: 1
Registered: February 2002
Junior Member
Hi,

I have 2 tables i want to join when selecting from. The first contains the user database (useridno and username). The second contains 3 columns (user_from_id,user_to_id,amount).

I would like to write a select statement to match usernames to the id's presented in the second table.

Any suggestions?

Cheers,

Dan
Re: Select from 2 tables [message #701 is a reply to message #698] Wed, 27 February 2002 07:01 Go to previous message
monir
Messages: 22
Registered: February 2002
Junior Member
hi i have this suggetion
select t1.useridno,t1.username,t2.user_from_id,t2.user_to_id,
t2.amount
from first_table t1,second_table t2
where t1.username = t2.user_from_id
and t1.username = t2.user_to_id;
i hope that succed for you
Previous Topic: Procedure Error
Next Topic: pls-00382
Goto Forum:
  


Current Time: Thu Mar 28 17:44:08 CDT 2024