0

Building on this post: MS Version of This MySQL View with GROUP BY?

How can subqueries be added?

All I want is to add to that view is an alias from a SELECT as an alias like:

... AS table2column2, (SELECT column1 FROM dbo.table3 WHERE constant = 1) AS table3column1, ...

Yes, I've looked everywhere. Interwebs have nada.

Thanks in advance!

Community
  • 1
  • 1

1 Answers1

1

Basically correct, just add a TOP 1 , as you cannot return more than one value:

(SELECT top 1 column1 FROM dbo.table3 WHERE constant = 1)
D'Arcy Rittich
  • 167,292
  • 40
  • 290
  • 283