CREATE OR REPLACE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `vn`.`ticketDownBuffer` AS SELECT `td`.`ticketFk` AS `ticketFk`, `td`.`created` AS `created`, `td`.`selected` AS `selected`, concat(`w`.`firstName`, ' ', `w`.`lastName`) AS `sacador`, `pk`.`code` AS `parking` FROM ( ( ( ( `vn`.`ticketDown` `td` JOIN `vn`.`ticketParking` `tp` ON(`tp`.`ticketFk` = `td`.`ticketFk`) ) JOIN `vn`.`parking` `pk` ON(`pk`.`id` = `tp`.`parkingFk`) ) JOIN `vn`.`ticketStateToday` `tst` ON(`tst`.`ticketFk` = `td`.`ticketFk`) ) JOIN `vn`.`worker` `w` ON(`w`.`id` = `tst`.`userFk`) ) WHERE `td`.`selected` = 2