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`