|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Need help on query
I need to write a query to join 3 tables.
Table a: emp_id, emp_name Table b: pub id,emp_id,pub_name Table c: loc_id,loc_name,pub_id write a query to fetch the loc_name of emp_name='seema' and pub_name='scooby' Can anybody pls help |
|
#2
|
||||
|
||||
|
Code:
SELECT C.loc_name FROM Table C As C INNER JOIN Table B As B On (C.pub_id = B.pub_id) INNER JOIN Table A As A On (B.emp_id = A.emp_id) WHERE A.emp_name = 'seema' AND B.pub_name = 'Scooby' |
![]() |
| Viewing: ASP Free Forums > Database > SQL Development > Need help on query |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|