Q&A for professional and enthusiast programmers
SELECT * FROM votes v inner join posts p on v.postid = p.id and p.owneruserid = ##userid##