You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Si un usuario no administrador intenta ejecutar la consulta1, se produce el error Not allowed table in query. Sin embargo, la consulta2 se ejecuta sin incidencias. La única diferencia entre ambas consultas es el acceso a la tabla sda_l_stic_payment_commitments_payment_type_stic_payments_types_.
Consulta 1
DATE_FORMAT(DATE_ADD(DATE_ADD(LAST_DAY(CURRENT_DATE()), INTERVAL 1 DAY), INTERVAL numbers.n-1 MONTH), '%Y-%m') AS Mes,
`sda_l_stic_payment_commitments_payment_type_stic_payments_types_`.`value` as `Tipo de pago` ,
sum(CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(spc.expected_payments_detail, '|', numbers.n), '|', -1) AS DECIMAL(10,2))) AS Importe
FROM
(
SELECT 1 AS n UNION ALL SELECT 2 UNION ALL SELECT 3 UNION ALL
SELECT 4 UNION ALL SELECT 5 UNION ALL SELECT 6 UNION ALL
SELECT 7 UNION ALL SELECT 8 UNION ALL SELECT 9 UNION ALL
SELECT 10 UNION ALL SELECT 11 UNION ALL SELECT 12
) AS numbers
CROSS JOIN
sda_stic_payment_commitments spc
LEFT JOIN `sda_l_stic_payment_commitments_payment_type_stic_payments_types_` ON spc.`payment_type` = `sda_l_stic_payment_commitments_payment_type_stic_payments_types_`.`code`
WHERE
numbers.n <= (LENGTH(spc.expected_payments_detail) - LENGTH(REPLACE(spc.expected_payments_detail, '|', ''))) + 1
AND SUBSTRING_INDEX(SUBSTRING_INDEX(spc.expected_payments_detail, '|', numbers.n), '|', -1) != '0'
group by `Mes`, `Tipo de pago`
ORDER BY
numbers.n
Consulta 2:
DATE_FORMAT(DATE_ADD(DATE_ADD(LAST_DAY(CURRENT_DATE()), INTERVAL 1 DAY), INTERVAL numbers.n-1 MONTH), '%Y-%m') AS Mes,
sum(CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(spc.expected_payments_detail, '|', numbers.n), '|', -1) AS DECIMAL(10,2))) AS Importe
FROM
(
SELECT 1 AS n UNION ALL SELECT 2 UNION ALL SELECT 3 UNION ALL
SELECT 4 UNION ALL SELECT 5 UNION ALL SELECT 6 UNION ALL
SELECT 7 UNION ALL SELECT 8 UNION ALL SELECT 9 UNION ALL
SELECT 10 UNION ALL SELECT 11 UNION ALL SELECT 12
) AS numbers
CROSS JOIN
sda_stic_payment_commitments spc
WHERE
numbers.n <= (LENGTH(spc.expected_payments_detail) - LENGTH(REPLACE(spc.expected_payments_detail, '|', ''))) + 1
AND SUBSTRING_INDEX(SUBSTRING_INDEX(spc.expected_payments_detail, '|', numbers.n), '|', -1) != '0'
group by `Mes`
ORDER BY
numbers.n
The text was updated successfully, but these errors were encountered:
Si un usuario no administrador intenta ejecutar la consulta1, se produce el error
Not allowed table in query
. Sin embargo, la consulta2 se ejecuta sin incidencias. La única diferencia entre ambas consultas es el acceso a la tablasda_l_stic_payment_commitments_payment_type_stic_payments_types_
.The text was updated successfully, but these errors were encountered: