[英]Using outer query value in sub-query - Getting error : “no such column … ”
[英]Effect of Order By in sub-query on outer query sorting
我有一個帶有子查詢的查詢,該查詢從其他表中獲取數據。 子查詢中的order by子句是否也以相同順序對外部查詢的記錄進行排序?
查詢的形式為:
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
子查詢中發生的情況保留在子查詢中。 它僅返回您要求的值。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.