My main problem is i dont know how to say select 1 on this cond select 2 on that cond. So i made them both their own statement. Is there a way to combine them?
select 1 from FlagContent where user=? and rev = ?;
select 2 from ContentRevision r
join ContentRevision r2 on r.content=r2.content
join FlagContent fc on fc.user=? and fc.rev = r2.id
where r.id=?;
Use
UNIONto “merge” similar result sets.However, there are some conditions to using it: