select field1, field2, null from table1
union all
select null, field3, field4 from table2
union all
select field5, null, field6 from table3
union all
select null, field3, field4 from table2
union all
select field5, null, field6 from table3
调试欢乐多
SELECT TOP 1 CMP_CODE,CMP_NAME FROM ORG_COMP地ANY WHERE CMP_NAME='SCARTEST'SELECT MIN(VALID_DATE) FROM INS_LABOR_SCALE_MSELECT COD_VAL FROM dbo.fnCODE('勞保費率別')
他們的字段類型完全不一樣,其中VALID_DATE是日期型,而其它的是字符型。