MySQL - Select All Except what is in this Table

前端 未结 5 1439
青春惊慌失措
青春惊慌失措 2020-12-21 19:14

I am wanting to select all images that a user does not already have.

I have three tables: user, image, and user_image:

5条回答
  •  情话喂你
    2020-12-21 19:33

    Try:

    SELECT
        i.*
    FROM
        _image i
        LEFT JOIN _user_image u ON u.image_id = i.id
    WHERE
        u.user_id != 
    

提交回复
热议问题