选择圆(K1,2)FROM(SELECT’5.666666’UNION ALL SELECT’5.7777’UNION ALL SELECT’5.88888’UNION ALL 选择’5.99999’UNION ALL 选择’6.66666’UNION ALL 选择’7 ….
列中的列别名 union [all] 结构来自于 的 第一 强> 查询,而不是最后一个。在那里移动你的别名,你应该没问题:
union [all]
SELECT ROUND(K1,2) FROM (SELECT 5.66666 AS K1 UNION ALL -- Here! SELECT 5.77777 UNION ALL SELECT 5.88888 UNION ALL SELECT 5.99999 UNION ALL SELECT 6.66666 UNION ALL SELECT 7.66666 UNION ALL SELECT 8.66666 UNION ALL SELECT 9.66666 UNION ALL SELECT 9.55555 UNION ALL SELECT 6.88888) K
为第一列的第一行提供别名,或为所有行提供别名 第一栏:
SELECT ROUND(K1,2) FROM ( SELECT '5.66666' AS K1 UNION ALL SELECT '5.77777' AS K1 UNION ALL SELECT '5.88888' AS K1 UNION ALL SELECT '5.99999' AS K1 UNION ALL SELECT '6.66666' AS K1 UNION ALL SELECT '7.66666' AS K1 UNION ALL SELECT '8.66666' AS K1 UNION ALL SELECT '9.66666' AS K1 UNION ALL SELECT '9.55555' AS K1 UNION ALL SELECT '6.88888' AS K1 ) K
为第一条记录提供列名,然后为记录使用相同的名称。
SELECT ROUND(K1,2) FROM (SELECT '5.66666' AS K1 UNION ALL SELECT '5.77777' UNION ALL SELECT '5.88888' UNION ALL SELECT '5.99999' UNION ALL SELECT '6.66666' UNION ALL SELECT '7.66666' UNION ALL SELECT '8.66666' UNION ALL SELECT '9.66666' UNION ALL SELECT '9.55555' UNION ALL SELECT '6.88888') K