2024-07-22 09:52:42 +00:00
|
|
|
CREATE OR REPLACE DEFINER=`vn-admin`@`localhost`
|
2024-01-15 11:31:03 +00:00
|
|
|
SQL SECURITY DEFINER
|
|
|
|
VIEW `vn`.`exchangeInsuranceIn`
|
|
|
|
AS SELECT `exchangeInsuranceInPrevious`.`dated` AS `dated`,
|
|
|
|
sum(`exchangeInsuranceInPrevious`.`amount`) AS `amount`,
|
|
|
|
cast(
|
|
|
|
sum(
|
|
|
|
`exchangeInsuranceInPrevious`.`amount` * `exchangeInsuranceInPrevious`.`rate`
|
|
|
|
) / sum(`exchangeInsuranceInPrevious`.`amount`) AS decimal(10, 4)
|
|
|
|
) AS `rate`
|
|
|
|
FROM `vn`.`exchangeInsuranceInPrevious`
|
|
|
|
GROUP BY `exchangeInsuranceInPrevious`.`dated`
|