简体   繁体   English

Sybase SQL 两个不同表的并集

[英]Sybase SQL union of two different tables

Is it possible to make a union from two tables with different number of columns, values and column types in Sybase SQL?是否可以从 Sybase SQL 中具有不同列数、值和列类型的两个表进行联合?

Sure, as long as the columns from the top and bottom part of the union can be converted to the same type.当然,只要联合的顶部和底部的列可以转换为相同的类型。 For example:例如:

select  intColumn as col1
,       charColumn as col2
,       decimalColumn as col3
from    Table1
union all
select  null
,       'Halelujah'
,       doubleColumn
from    Table2

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM