Answer the question
In order to leave comments, you need to log in
Subqueries. What to write after the second select?
Hello!
Tell me what to write after the second select'a?
Example, there are two tables (T1 - orders table, T2 - geographical points table).
Expected result: display of all orders where the name of the city (acceptance) begins with "KA".
select *
from T1
where t1.DEST_LOCATION_GID IN (select t2.LOCATION_GID
from T2
where t2.location_NAME like 'КА%')
Answer the question
In order to leave comments, you need to log in
Do it via join, you don't need in here:
select t1.* from T1 as t1
left join T2 as t2 on t2.location_NAME like 'КА%' and t2.LOCATION_GID=t1.DEST_LOCATION_GID
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question