tumchaaditya
tumchaaditya

Reputation: 1297

Subquery returning multiple rows in coalesce

This may seem a little dumb question but what happens if I have a subquery in COALESCE which returns 2 records like this:

select
coalesce(<some subquery>,'') as "result",
column2, column3, .....
from <table name>

Now if the subquery returns 2 results what will the output of whole query?

Upvotes: 1

Views: 608

Answers (1)

juergen d
juergen d

Reputation: 204774

You will get an error saying that the subquery returns more than 1 row.

Upvotes: 2

Related Questions