Click here to Skip to main content
15,888,176 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello everyone! I've managed to create reports from 1 table. My question is how to create a report from 2 tables (are filled from oracle 10g DB)?
I have a DataSet with 2 tables like this:

Table Customer:
ID (PK)
NAME
ADRESS

Table Producs:
ID
PRODUCT_NAME
BUYER (FK - ID from Customer)

Ok. Now I want to display the report with all customers and what they bought, as an example:

ID NAME
3 Scott
BUYER PRODUCT_NAME
3 TV
3 CAR
3 TOY
ID NAME
4 John
and so on
------------------------------------

Thank you in advance for your help.
Posted
Updated 5-Dec-09 2:42am
v2

The keyword you want is inner join

select c.Name, c.Address, p.ProductName from Customer c inner join Product p where c.ID = p.Buyer
 
Share this answer
 
That was the answer and thank you for help.

Have a great day,
Sandu
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900