Help Me [message #189914] |
Mon, 28 August 2006 08:11 |
vivek_g_r
Messages: 15 Registered: May 2005
|
Junior Member |
|
|
Hi,
The following is my Table Structure :
TABLE 1
PS_SHOP_CODE QTY
CHENNAI 250
HYDERABAD 300
BANGALORE 600
TABLE 2
SHOP QTY
CHENNAI 250
HYDERABAD 300
BANGALORE 600
I need the result as follows
SHOP TAB1_QTY TAB2_QTY
CHENNAI 250 250
HYDERABAD 300 350
BANGALORE 600 600
Kindly help me out.
Regards
R.Vivekanandaan
|
|
|
Re: Help Me [message #189915 is a reply to message #189914] |
Mon, 28 August 2006 08:18 |
|
Maaher
Messages: 7065 Registered: December 2001
|
Senior Member |
|
|
First, a small remark. Use topic titles that acutally say something about the subject. "Help me" is a bad, very bad, title.
Then there's your question. A join can help you out. Something like this (warning, untested!) should do the trick:
select t1.ps_shop_code shop
, t1.qty tab1_qty
, t2.qty tab2_qty
from table_1 t1
, table_2 t2
where t1.ps_shop_code = t2.shop
/ The "350" for HYDERABAD for tab2_qty is a typo?
MHE
|
|
|