I've got 3 tables with different structures, which share the same logical column: price. I want to find the biggest price from all records from all 3 tables. I'm trying something like:
SELECT MAX(price) FROM (
SELECT MAX(price) FROM pc
UNION
SELECT MAX(price) FROM printer
UNION
SELECT MAX(price) FROM laptop
);
but I get an syntax error: Incorrect syntax near ';'.. What is wrong and how it should look like? This should be compatible to the SQL standard, not a particular RDBMS.