Home » SQL & PL/SQL » SQL & PL/SQL » Help Me
Help Me [message #189914] Mon, 28 August 2006 08:11 Go to next message
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 Go to previous message
Maaher
Messages: 7062
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
Previous Topic: Decode help
Next Topic: loading CLOB data into Oracle 9i tables
Goto Forum:
  


Current Time: Thu Dec 08 02:14:08 CST 2016

Total time taken to generate the page: 0.19361 seconds