I have a query with sub-query getting data from other tables. Does the order by clause in sub-query also sorts the records of the outer query in the same order??
Query is of the form:
select p.email email, max(p.firstname) firstname,max(p.lastname) lastname
from abc p, xyz c
where p.companyid=c.companyid
and c.company!=''
and locationid in (
select locationid
from mno tr
where 1=1
AND tr.inc in (7,8,9)
AND tr.topic in( 'Callidus Cloud')
AND tr.inc IS NOT NULL
order by inc desc
)
AND c.crange IN ('100-249','250-499','500-999','1000-4999'
,'5000-9999','50000-100000','>100000')
group by p.email limit 7 offset 0
What happens in sub query remains in sub query. It only returns the value you asked for.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.