错了

(
SELECT '' AS Code,type as Type
FROM test1
WHERE 1 
)
UNION ALL (SELECT code AS Code,'' as Type
FROM test2
WHERE 1 

解决方案 »

  1.   

    在mysql4.1和5.0下测试,都可以正常显示结果,并没有出现你说的情况。(
    SELECT '' AS Code
    FROM test1
    WHERE 1 
    )
    UNION ALL (SELECT code AS Code
    FROM test2
    WHERE 1 

    类型转化函数你可以使用CAST()函数。如:
    ...where mydate>cast('2000-01-01' as date) ...
      

  2.   

    我的mysql是4.0.12,上诉问题存在。