This content has been marked as final. Show 4 replies
If I understand correctly what you are looking for:
inner join votetable
on songtable.songid = votetable.songid
where vote = null
or vote < 4
I don't think that's going to work. The voting table looks like this:
Data would be like this:
That kind of thing. If there is no entry for a particular songID in the voting table, the inner join would eliminate it from showing a result.
You need a left join:
FROM song LEFT JOIN vote ON song.ID = vote.songid
This will show ALL records on the song side where id = vote.songid
how about something like this?
SELECT Songs.SongTitle,Count(Votes.yesNo) AS CountOfVote
FROM Songs LEFT JOIN Votes ON Songs.SongID = Votes.SongID
GROUP BY Songs.SongTitle
HAVING COUNT(Votes.yesNo) < 4;
you might have to modify some column names but this format should give you what you seek.
let me know how this works.