当前位置: 代码迷 >> DB2 >> db2 union有关问题
  详细解决方案

db2 union有关问题

热度:2741   发布时间:2013-02-26 00:00:00.0
db2 union问题
union   时   必须   列数相等,
两个表   后面一个少三个字段   (int   varchar   int   )   在   sqlserver   可以有   null   nulll   null   代替
db2   中   varchar   可以有   ‘null’   数字怎么办

------解决方案--------------------------------------------------------
cast (null as int)
------解决方案--------------------------------------------------------
select 1,cast ( null as varchar(1)) from test
用cast(null as ...)来转换你需要的类型。