Cheelo X
Cheelo X

Reputation: 33

SQL CASE return Dataset

I just have a quick question. Can you receive a set of data in a case statement similar to:

CASE WHEN 1 = 1 THEN (SELECT name, age, gender FROM people) END

Upvotes: 1

Views: 80

Answers (1)

Gordon Linoff
Gordon Linoff

Reputation: 1269883

No, you cannot do this with a case expression in a select statement.

A case expression is a scalar expression, so it can return only one value.

I should note that some databases support tuples. In those databases, the values could be combined into a single tuple.

Upvotes: 1

Related Questions