salix/db/routines/vn/views/item_Free_Id.sql

11 lines
268 B
MySQL
Raw Normal View History

2024-08-20 08:06:10 +00:00
CREATE OR REPLACE DEFINER=`vn`@`localhost`
SQL SECURITY DEFINER
VIEW `vn`.`item_Free_Id`
AS SELECT `i1`.`id` + 1 AS `newId`
FROM (
`vn`.`item` `i1`
LEFT JOIN `vn`.`item` `i2` ON(`i1`.`id` + 1 = `i2`.`id`)
)
WHERE `i2`.`id` IS NULL
AND `i1`.`isFloramondo` <> 0