根据http://www.storytotell.org/blog/2008/11/14/literal-tables-and-updates-with-joins-in-sql.html,以下内容是有效的:
SELECT *
FROM VALUES
('Lisp', 50, true),
('Scheme', 30, true),
('Clojure', 1, true)
AS languages (name, age, lispy)
但它似乎没有起作用。
我能得到的最好结果是
With languages (name, age, lispy) as
(
select 'Lisp', 50, 'true' union all
select 'Scheme', 30, 'true' union all
select 'Clojure', 1, 'true'
)
select * from languages
这个查询使用一个常见表达式,不如其他方法优雅。
t-sql 中是否有类似于表面值的东西?