Código Python:
Ver original
( SELECT 1 'tabla_id', id 'id', title_es 'title', detail_es 'description' FROM `tablauno` WHERE qty >0 AND title_es LIKE '%a%' AND title_es IS NOT NULL ) UNION ( SELECT 2 'tabla_id', id 'id', title_es 'title', description_es 'description' FROM `tablados` WHERE title_es LIKE '%a%' AND title_es IS NOT NULL ) UNION ( SELECT 3 'tabla_id', id 'id', title_es 'title', description_es 'description' FROM `tablatres` WHERE title_es LIKE '%a%' AND title_es IS NOT NULL )