no, what pootle wants to know is which database system you are using
access? sybase? informix? db2? firebird? oracle? sql server?
you see, the answer to the question you asked might depend on what database system you're using
also, you need to be a wee bit more specific
first, you say "from each of the tables i need to create a chart"
so that sounds like 8 charts
but then you say "the top 3 figures between all the tables"
furthermore, you also need to give some information on
which top 3 -- "top" doesn't make sense unless you tell us what it is based on
it sounds like it would be based on a COUNT(*) but it's hard to tell from over here
here is the way i would solve it --
Code:
with combined_tables as
( select foo, bar, qux from table1
union
select foo, bar, qux from table2
union
select foo, bar, qux from table3
union
select foo, bar, qux from table4
union
select foo, bar, qux from table5
union
select foo, bar, qux from table6
union
select foo, bar, qux from table6
union
select foo, bar, qux from table8 )
select foo, bar, qux
from combined_tables as t
where ( select count(*)
from combined_tables
where qux > t.qux ) < 3
that's standard sql, and i've used placeholder names for the table and column names that you forgot to tell us, so if that doesn't work in your particular database system, then next time you will know how to ask the question better, yes?
