From da2a2b5f09cb85d4f01da06265db356fe96780dd Mon Sep 17 00:00:00 2001 From: ivanm Date: Tue, 30 Jan 2024 13:33:54 +0100 Subject: [PATCH] refs #6444 Remove vn2008.intrastat_neto function --- .../vn2008/functions/intrastat_neto.sql | 20 ------------------- 1 file changed, 20 deletions(-) delete mode 100644 db/routines/vn2008/functions/intrastat_neto.sql diff --git a/db/routines/vn2008/functions/intrastat_neto.sql b/db/routines/vn2008/functions/intrastat_neto.sql deleted file mode 100644 index 34e01de8c..000000000 --- a/db/routines/vn2008/functions/intrastat_neto.sql +++ /dev/null @@ -1,20 +0,0 @@ -DELIMITER $$ -CREATE OR REPLACE DEFINER=`root`@`localhost` FUNCTION `vn2008`.`intrastat_neto`(intINSTRASTAT INTEGER,intUNIDADES INTEGER) - RETURNS double - DETERMINISTIC -BEGIN - - DECLARE n DOUBLE; - - SELECT ROUND(intUNIDADES / (SUM(MEDIA) / COUNT(media)), 2) INTO n FROM - (SELECT *, unidades / neto MEDIA - FROM intrastat_data - WHERE intrastat_id = intINSTRASTAT AND neto - AND unidades > 0 - ORDER BY odbc_date DESC - LIMIT 20) t; - -- JGF 01/06 per a evitar Kg en negatiu - RETURN n/2; - -END$$ -DELIMITER ;