Joining 4 Tables in SQL Server Using Join

前端 未结 2 1580
南方客
南方客 2021-02-09 18:15

Hi Friends I have to join 4 tables in SQL Server and need to Show Specific Coulmns in Data Grid View

First Table : emp_details

2条回答
  •  说谎
    说谎 (楼主)
    2021-02-09 19:06

        SELECT e1.emp_id, e1.emp_name, e1.emp_pf, e2. designation_name, e3.pfacc1, e3.pfacc2, e4. pf_percent,  e4.pf_max 
    
    from emp_details e1, tbl_designation e2, tbl_empcontribution e3, tbl_empdeduction e4
    
     where e1.emp_id= e2.emp_id and e2.emp_id=e3.emp_id and e3.emp_id= e4.emp_id;
    

    assuming you have emp_id as foreign key in all 4 tables

提交回复
热议问题