![](/img/trans.png)
[英]A single function for select query in a project its execution or loading time is fast or slow
[英]sql query while i am excuting select query its loading for long time its not resulting its only loading
它不會導致其加載
select p.*
from contacts p left outer join
(select articleno, size, count(*) as cnt
from bsd t
group by articleno, size
) bc
on p.articleno = bc.articleno and p.size = bc.size
where coalesce(cnt, 0) < (select count(*)
from contacts p2
where p2.articleno = p.articleno and
p2.size = p.size and
p2.id <= p.id
);
上面的查詢有很多子查詢,由於這些子查詢的處理速度變慢,並且如果數據量增加,它將變得更糟,因此最好選擇任何其他方式來獲取數據,或者使用EXPLAIN查看問題出在哪里
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.