我在两个表上有一个简单的连接,大约需要50秒来执行,我不太清楚为什么?
代码如下:
SELECT
LEFT(t1.group, 3) AS `Group`,
max(t1.`Z-indexnummer`) As 'ZI-Nummer',
count(t1.`Z-indexnummer`) As 'PacksDispensed',
t2. `Artikelomschrijving: inkoophoeveelheid (aantal)`as 'Packsize',
t2.`Prijs: apotheekinkoop (ex. BTW)` As 'Prijs EX BTW',
Afleverapotheek, Zorgverzekeraar, Basisproduct, Etiketnaam,
t2.`Gm.: productnaam: PRK=prescriptie (code)`, t2.`Naam: productverantwoordelijke`,
t2.`Inkoopkanaal (code)`,
t3.mnvddd
FROM My_Data as t1
INNER JOIN ZINummer as t2 ON t1.`Z-indexnummer` = t2.`Artikelnummer: ZI-nummer`
INNER JOIN Idea as t3 ON t1.`Z-indexnummer` = t3.atkode
WHERE
t1.`VPV-Weekaflevering` = '0, Gewone Levering'
group by t1.`Z-indexnummer`
order by PacksDispensed desc;
有人有什么想法吗?非常感谢你的帮助。
谢谢
暂无答案!
目前还没有任何答案,快来回答吧!