![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi, I have two tables: the first one has all details about persons, the second associate the id of each person to the id of his team leader (id_boss). Bosses themselves are present in the first table DETAILS_TBL id_person first_name name PERSON_IN_GROUP_TBL id_person id_boss I must make a query to have this result [employee] - [boss] john - smith - jack - doe michael - ross - jack - doe jack - doe - jack - doe tom - cruise - al - pacino etc I use mysql and postgresql but I can't imagine a sql statement to do this. Anyone can help me? :-) BR, Filippo |
#3
| |||
| |||
|
|
You may need to clean up the column headers, but you get the idea. |
#4
| |||
| |||
|
|
David Cressey ha scritto: You may need to clean up the column headers, but you get the idea. fine, I have to digest this :-). My problem is that I have to implement a search query like SELECT (ALL THE QUERY YOU SHOWN) WHERE details_tbl.first_name = 'john' How can I do? |
![]() |
| Thread Tools | |
| Display Modes | |
| |