Mit der neueren Join
t-Syntax hast du es auch schonmal versucht?
SQL-Code:
SELECT sp.id_catalogpart AS "id", sp.id_station AS "id1", sp.id_location AS "id2", sum(sp.quantity) AS "count"
FROM mtx_stockparts sp
JOIN mtx_catalogparts cp ON sp.id_catalogpart = cp.id
JOIN cd_stations st ON sp.id_station = st.id
WHERE sp._entrytype = 0
AND st._deletedat IS NULL
AND sp._deletedat IS NULL
GROUP BY sp.id_catalogpart, sp.id_station, sp.id_location
Ob das so einen Unterschied ausmacht, weiß ich nicht.
SQL-Code:
SELECT sp.id_catalogpart AS "id", sp.id_station AS "id1", sp.id_location AS "id2", sum(sp.quantity) AS "count"
FROM mtx_stockparts sp
JOIN mtx_catalogparts cp ON sp.id_catalogpart = cp.id
JOIN cd_stations st ON st._deletedat IS NULL AND sp.id_station = st.id
WHERE sp._entrytype = 0 AND sp._deletedat IS NULL
GROUP BY sp.id_catalogpart, sp.id_station, sp.id_location