SQL join, getting multiple columns with same name

后端 未结 3 1879
夕颜
夕颜 2021-02-13 21:03

I have one table with a column ID and SERVICE_TYPE_TEXT, and another table with columns

ID, SERVICE_TYPE ... 

and lot

3条回答
  •  南笙
    南笙 (楼主)
    2021-02-13 21:11

    Try something like this,

    SELECT a.ID AS ServiceID,
           a.Service_Type_Text,
           b.ID AS table2ID,
           b.Service_Type
    FROM   table1 a
           INNER JOIN table2 b
               ON a.ID = b.Service_Type
    

提交回复
热议问题