˙ūSELECT * FROM ssru_falang_content WHERE reference_id in ( SELECT id FROM ssru_k2_items WHERE catid in ( SELECT id FROM ssru_k2_categories WHERE name LIKE '%H2'%' ) and published =1) AND reference_table = 'k2_items' AND reference_field = 'title' order by reference_id desc CREATE OR REPLACE VIEW vw_items AS SELECT '2' as 'sites',ssru_k2_items.* FROM ssru_k2_items WHERE catid IN ( SELECT id FROM ssru_k2_categories WHERE name LIKE '%H2'%' ) AND published =1 ORDER BY created DESC LIMIT 1 CREATE OR REPLACE VIEW vw_falang AS SELECT '2' as 'sites', ssru_falang_content .* FROM ssru_falang_content WHERE reference_id in (select id from vw_items ) AND reference_table = 'k2_items' AND reference_field = 'title' order by reference_id desc SELECT * FROM test.vw_items UNION SELECT * FROM joom25.vw_items CREATE OR REPLACE VIEW vw_items_total AS SELECT * FROM test.vw_items UNION SELECT * FROM joom25.vw_items SELECT * FROM ssru_k2_items WHERE created >= DATE_ADD( NOW( ) , INTERVAL -4 DAY ) LIMIT 0 , 30