SELECT artists.name FROM `artists` left join song_artists on artists.id = song_artists.artist_id WHERE song_artists.song_id = "003dc512121c4dfb898184565b92e8e8" AND `artists`.`deleted_at` IS NULL AND song_artists.`deleted_at` IS NULL
实际输出
SELECT artists.name FROM `artists` left join song_artists on artists.id = song_artists.artist_id WHERE song_artists.song_id = "003dc512121c4dfb898184565b92e8e8" AND `artists`.`deleted_at` IS NULL
使用join关联查询数据时候发现关联表没有自动过滤掉软删除的数据
代码:
期望输出
实际输出