JOINING TWO TABLES - Mailing list pgsql-novice

From vamseelist@gmail.com
Subject JOINING TWO TABLES
Date
Msg-id d5a501400708060907h7cd5d5dey8f762cb845655e6e@mail.gmail.com
Whole thread Raw
Responses Re: JOINING TWO TABLES
List pgsql-novice
Hi ,
      I have two tables
First table is employee table

EMP_ID Ename     MGR_ID
----------   --          ----------
       1     a           1
       2     b           1
       3     c           2



Second one is manager table

MGR_ID Manager name
----------    --------------------
       1     d
       2      e



as managers are employees i joined those two tables
the result is

EMP_ID EM     MGR_ID
----------   --         ----------
       4    d
       5    e
       1    a           1
       2    b           1
       3    c           2



now i would like to give emp ids to mgr ids.

I mean d,e got 1 and 2 in mgr table.
d,e got 4,5 in new table.

I would like to replace 1 1 2 with 4 4 5.

I would like to modify above table as


EMP_ID EM     MGR_ID
----------   --         ----------
       4    d
       5    e
       1    a           4
       2    b           4
       3    c           5



Plz help me
Thanks
satya

pgsql-novice by date:

Previous
From: Tom Lane
Date:
Subject: Re: doubt about datum
Next
From: Richard Broersma Jr
Date:
Subject: Re: JOINING TWO TABLES