在此帖子的基础上:MS Version of This MySQL View with GROUP BY?
如何添加子查询?
我想要的只是添加到该视图是SELECT的别名,如别名,如:
... AS table2column2, (SELECT column1 FROM dbo.table3 WHERE constant = 1) AS table3column1, ...
是的,我到处寻找。互联网有nada。
提前致谢!
答案 0 :(得分:1)
基本上是正确的,只需添加TOP 1
,因为您不能返回多个值:
(SELECT top 1 column1 FROM dbo.table3 WHERE constant = 1)