Hey.
Question on sql on "Subqueries". There is a scalar subquery - it returns one value. A scalar subquery can be placed, for example, to the right of the = operator. That is, a scalar query returns a single row and shows one column in a row — in my hand is a cell from which you can pull a VALUE (for example, a number) and put this value to the right of the equal sign. There are no questions for scalar subquery yet. With scalar queries, the operators <,>, <= ... are applied.
The request can also return a TABLE or STRING. This is a non-scalable query. They write that to work with such non-scalable queries there are operators IN,ANY,ALL .. I don’t understand how, for example, a query that returns several lines to be pushed into the same IN is obtained ..IN (and here is the table) .
In IN you can pass multiple values separated by commas (... IN(1,3,5); - this use case is clear to me). For example, this
...WHERE id IN(1,3,5); You can rewrite it like this:
...WHERE id=1 OR id=3 OR id=5;
(x,y) IN( (1,2), (3,4) )similarly(x=1 and y=2) OR (x=3 and y=4)for this variant the subquery should return a two-column table - Mike