Website Development Prices

Search Blog

Wednesday, October 21, 2015

Podupiti koji vracaju redove podataka (Subqueries that return rows of data)

Svi primeri koje smo do sada videli vracali su samo po jednu vrednost. Postoje i upiti koji vracaju ceo red podataka, koji se moze porediti sa redovima podataka u spoljasnjem upitu.

Ako vam je potrebno da pronadjete sve redove u jednoj tabeli koji postoje i u drugoj tabeli. Opsti oblik sintakse:

select c1, c2, c3
from t1
where (c1, c2, c3) in (select c1, c2, c3 from t2);

All the examples we have seen so far returned only one value. There are queries that return the entire row of data, which is comparable to the data with rows in the outer query.

If you need to find all the rows in a table that also exist in the other table. The general syntax:

SELECT c1, c2, c3
FROM t1
WHERE (c1, c2, c3) in (SELECT c1, c2, c3 FROM t2);

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.