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

9 lines
290 B
SQL

CREATE OR REPLACE DEFINER=`root`@`localhost`
SQL SECURITY DEFINER
VIEW `vn`.`firstTicketShipped`
AS SELECT min(`vn`.`ticket`.`shipped`) AS `shipped`,
`vn`.`ticket`.`clientFk` AS `clientFk`
FROM `vn`.`ticket`
WHERE `vn`.`ticket`.`shipped` > '2001-01-01'
GROUP BY `vn`.`ticket`.`clientFk`