首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > 其他数据库 >

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

2012-07-25 
union查询2个表的2个不同类型的字段select to_char(a.name) name_a from a union select to_char(b.name)

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 不去掉重复

热点排行