Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Newbie: Query match one field in all tables.

Status
Not open for further replies.

raboo2u

Technical User
Aug 14, 2002
21
US
I have the following tables/Fields

First_Time_Buyer(table)

Fields

User_Id
Dollar_Loss
Potential_loss

Coupon_Seller (Table)

Fields

User_Id
Total_Purch
Num_Loss
Dollar_Loss
Dollar_Prevented
Num_Prevented

Fraud_Buyer (table)

Fields

User_Id
Dollar_Loss

I want to match any User_Id that is in every table and return all values from every table for that User_id. I am new to this and would like to create a query for this. Can anyone help?



 
Code:
SELECT *
FROM First_Time_Buyer t1
  JOIN Coupon_Seller t2 ON t1.user_id = t2.user_id
  JOIN Fraud_Buyer t3 ON t1.user_id = t3.user_id

--James
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top