The current query is:
update topics set posts = (select count(*) from posts where tid = 27), lastpost = (select max(pid) from posts where tid = 27) where tid = 27;
How do I merge the two sub-queries into this for the update query?
select count(*), select max(pid) from posts where tid = 27)
I could execute this as two separate queries obviously (read values from posts, write values to topics) but I'd like to do it in a single query if possible.