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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Query

Status
Not open for further replies.

naga5566

Technical User
Joined
Mar 14, 2003
Messages
90
Location
US
Hi ,
I need a simple query which outputs following and is based on 2 tables.

Output needed

Prod_Code | Product_line | Prod_desc |
Abc 1 T-Shirt A
Abc 2 T-shirt B
Abc 3 NULL

The table columns and the data are below

Table 1 Table 2

Prod_code Prod_code
Product_line Product_line
Prod_desc
Table 1 has
Prod_Code | Product_line
Abc 1
Abc 2
Abc 3

Table 2 has

Prod_Code | Product_line | Prod_desc |
Abc 1 T-shirt A
Abc 2 T-shirt B
 
This looks a whole lot like homework. Is this related to Business Objects at all?

I'm not going to write SQL code for you, but I will give you a hint. You need an outer join. Then your query will return all the rows form Table1 whether they have a match in Table2 or not.


Steve Krandel
BASE Consulting Group
skrandel@baseconsulting.com
 
Thanks anyway.
I got it
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top