I have two tables tracklist and song. I am fetching all values from song having sid as primary and tracklist having sid as foreign. Though fetching all values from song using this query is successfull.
SELECT t.sid as tsid, s.sid as ssid, s.name from song s LEFT JOIN tracklist t ON s.sid=t.sid;
But If I wish to fetch those values from song that are not in tracklist this query is not fetching single row.
SELECT t.sid as tsid, s.sid as ssid, s.name from song s LEFT JOIN tracklist t ON s.sid=t.sid where t.sid= NULL;
JOINor aINNER JOINinstead of aLEFT JOIN?tsidinstead oft.sidin the WHERE clause