MySQL - specific columns on join?

前端 未结 4 1173
抹茶落季
抹茶落季 2021-02-19 08:20

When making a join (inner, left outer, right outer or whatever), how can I specify which columns on the table to join into the original table?

Consider the following exa

4条回答
  •  灰色年华
    2021-02-19 08:48

    This will only include User.FirstName and Provider.ProviderID in the final resultset:

    SELECT User.FirstName, Provider.ProviderID FROM User LEFT OUTER JOIN Provider ON User.ProviderID = Provider.ID
    

提交回复
热议问题