We have tables A, B, and C, and we would like to find A related to a particular C.
SELECT*
FROM A A
INNER JOIN B
ON b.id = a.b_id
LEFT JOIN CC
ON c.b_id=b.id AND c.type='hogehoge'
WHERE c.id IS NULL
At this time, other types other than c.type='hogehoge'
are also extracted.
If you only want to extract records with type='hogehoge'
, use c.type='hogehoge'
as an extraction condition, not a merge condition.
SELECT*
FROM A A
INNER JOIN B
ON b.id = a.b_id
LEFT JOIN CC
ON c.b_id=b.id
WHERE c.type = 'hogehoge'
594 Uncaught (inpromise) Error on Electron: An object could not be cloned
575 PHP ssh2_scp_send fails to send files as intended
871 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
567 Who developed the "avformat-59.dll" that comes with FFmpeg?
566 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
© 2024 OneMinuteCode. All rights reserved.