select *From t_ecp_data t where t.enble='Y'
union all
select *from t_entity_path_indext_ecp_data t_entity_path_index表结构不一样
union all
select *from t_entity_path_indext_ecp_data t_entity_path_index表结构不一样
调试欢乐多
你想把两张表的数据都列出来?还是想干嘛?
结构不一样,需要指明结果中的列,两个表的结果列相同即可,如:
select A,B,C From t_ecp_data t where t.enble='Y'
union all
select A,B,C from t_entity_path_index
如果列的个数不同,但可以只查询指定的列,也是可以的。
举例:
Products(product_id, product_type_id, name, description, price)
MoreProducts(prd_id, prd_type_id, name, available)select product_id as id, product_type_id as ptid, name
from products
union all
select prd_id as id, prd_type_id as ptid, name
from MoreProducts;