Three tables join in SQL

前端 未结 2 422
星月不相逢
星月不相逢 2021-01-28 19:17

I am newbie in SQL. I want to join three tables in SQL. Below is my query, please check and correct me where I am wrong -

Tables:

  • CARD: ID,Code,Name,CC
2条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-28 19:21

    SELECT * FROM CARD INNER JOIN PGMeCode ON PGMeCode.Code = CARD.Code AND PGMeCode.CC = CARD.CC INNER JOIN PGM ON PGM.Code = Card.Code WHERE Card.ID = 'SomeThing';
    

    Try this query

提交回复
热议问题