This commit is contained in:
parent
a2f2ed743d
commit
f687994a7f
|
@ -8,16 +8,11 @@ BEGIN
|
||||||
*
|
*
|
||||||
* @param vSelf Id ruta
|
* @param vSelf Id ruta
|
||||||
*/
|
*/
|
||||||
CREATE OR REPLACE TEMPORARY TABLE tRouteVolume
|
DECLARE vVolume DECIMAL(10,1)
|
||||||
ENGINE = MEMORY
|
DEFAULT (SELECT SUM(volume) FROM saleVolume WHERE routeFk = vSelf);
|
||||||
SELECT IFNULL(SUM(volume), 0) volume
|
|
||||||
FROM saleVolume
|
|
||||||
WHERE routeFk = vSelf;
|
|
||||||
|
|
||||||
UPDATE `route`
|
UPDATE `route`
|
||||||
SET m3 = (SELECT volume FROM tRouteVolume)
|
SET m3 = IFNULL(vVolume, 0)
|
||||||
WHERE id = vSelf;
|
WHERE id = vSelf;
|
||||||
|
|
||||||
DROP TEMPORARY TABLE tRouteVolume;
|
|
||||||
END$$
|
END$$
|
||||||
DELIMITER ;
|
DELIMITER ;
|
||||||
|
|
Loading…
Reference in New Issue