none
find sql table name with a particular column in Multiple Join sql queries RRS feed

  • Question

  • Hi,

     I have a sql query with multiple joins,How can I get the selected columns to corresponding sql table name.

     Input:

     Select A.Id,A.Name,B.Salary

     from

     Table1 A Inner Join Table2 B On  A.Id=B.Id

    Output:

    -----------------------------------

    Table Name |  Column Name

    -----------------------------------

    Table1         | Id

    Table1         | Name

    Table2         | Salary

    -----------------------------------

    Thanks,

    Krishnan 


    Monday, February 24, 2020 11:10 AM

Answers