Skip to content
Advertisement

How add select in list without join

I don’t need to join in a whole table, but just want a value from the table returned in my select list (but other tables are joined for other items). It’s giving me an error…incorrect syntax near select

I’m having trouble searching online for this.

Advertisement

Answer

Assuming the scalar subquery returns one row at most, you can enclose it between parenthesis, as in:

If the scalar subquery returns more than one row the whole query will crash.

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement