Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DELIMITER $$
- DROP FUNCTION IF EXISTS `HORAS` $$
- CREATE DEFINER=`root`@`localhost` FUNCTION `HORAS`(codigo1 int) RETURNS int(30)
- BEGIN
- declare tiempo int default 0;
- select sum(hora) total_horas into tiempo from
- (select HOUR(TIMEDIFF(pru_hora_final,pru_hora_inicio)) hora,cas.cas_nombre nombre,cas.cas_codigo codigo from casting cas,fase fas,prueba pru
- where cas.cas_codigo=fas.fas_cas_codigo_FK and fas.fas_numero_invidual=pru.pru_numero_invidual_FK) tabla1
- where codigo=codigo1;
- RETURN tiempo;
- END $$
- DELIMITER ;
Add Comment
Please, Sign In to add comment