I have multiple tables, table_a, table_b, table_c. Each having the same structure. i.e ID, title, rating, content. I'm using
(select * from table_a order by rating DESC) union (select * from table_b order by rating DESC) union (select * from table_c order by rating DESC)
to list all titles from a,b,c tables. But it only lists tables one after the other.
How can I list top ten rated titles from all the tables.