Originally Posted by Old Pedant
SELECT MAX(U.views) FROM (
SELECT views FROM table1
SELECT views FROM table2
) AS U
You *might* get better performance from:
SELECT MAX(U.maxview) FROM (
SELECT MAX(views) AS maxview FROM table1
SELECT MAX(views) AS maxview FROM table2
) AS U
You can try it both ways.
It will show only one reslt, doesnt it?
And if I want to show the the top 3?
I found out how to do it and it works,
$getcontent = "SELECT .. FROM
( SELECT .. FROM moviesdb
SELECT ... FROM gamesdb ORDER BY views DESC LIMIT 3) views";
but I got anothing problem.
I need to check from what databse I got the result, and I have no idea how to do it and where to place the "AS" or these things.