Mysql left join with condition in right table

前端 未结 2 1135
说谎
说谎 2020-12-07 01:42

I have been trying to solve this issue for a while, hope anyone help me. I am having two table, the first table is

Table Name : OnlineTest

2条回答
  •  清歌不尽
    2020-12-07 02:01

    You can also use left outer Join as below :

    SELECT        c.OnlineTestId, d.userId, d.status
    FROM            OnlineTest AS c LEFT OUTER JOIN
                             UserStatus AS d ON d.onlineTestId = c.OnlineTestId AND d.userId = 1
    WHERE        (c.category = 'English')
    

提交回复
热议问题