日期:2014-05-16  浏览次数:20413 次

union查询2个表的2个不同类型的字段

select to_char(a.name) name_a from a union select to_char(b.name) name_b from b

?

强行转换2个字段的类型为char型,在查询的结果集中就可以正常显示这2个结果了

?

?

另:

union 去掉重复

union all 不去掉重复