Joining 4 Tables in SQL Server Using Join

前端 未结 2 1582
南方客
南方客 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:02

    Below is the query you need, you should consider keeping your naming conventions consistent because this helps visually and reduce bugs when writing code.

    SELECT ed.emp_id, ed.emp_name , ed.emp_pf, emd.designation_name, te.pfacc1, te.pfacc2, temp. pf_percent, temp.pf_max
    FROM dbo.emp_details AS ed
    LEFT JOIN dbo.emp_designation AS emd ON emd.designation_id = ed.emp_designation 
    LEFT JOIN dbo.tbl_empcontribution AS te ON te.eid = ed.emp_id
    LEFT JOIN dbo.tbl_empdeduction AS temp ON temp.eid = ed.emp_id
    

提交回复
热议问题