CREATE TABLE merge_table (table definition) TYPE=MERGE UNION=(table1,table2) SELECT tok, COUNT(tok) FROM merge_table GROUP BY tok