JOINING TWO TABLES
От | vamseelist@gmail.com |
---|---|
Тема | JOINING TWO TABLES |
Дата | |
Msg-id | d5a501400708060907h7cd5d5dey8f762cb845655e6e@mail.gmail.com обсуждение исходный текст |
Ответы |
Re: JOINING TWO TABLES
|
Список | 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
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 по дате отправления: