Cannot execute query: SELECT * FROM furniture.pics RIGHT JOIN (SELECT * FROM furniture.listings where category = 1) as l on l.id = furniture.pics.id