Guest User

Untitled

a guest
Jun 20th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. DELIMITER $$
  2.  
  3. DROP FUNCTION IF EXISTS `HORAS` $$
  4. CREATE DEFINER=`root`@`localhost` FUNCTION `HORAS`(codigo1 int) RETURNS int(30)
  5. BEGIN
  6.  
  7. declare tiempo int default 0;
  8. select sum(hora) total_horas into tiempo from
  9. (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
  10. where cas.cas_codigo=fas.fas_cas_codigo_FK and fas.fas_numero_invidual=pru.pru_numero_invidual_FK) tabla1
  11. where codigo=codigo1;
  12. RETURN tiempo;
  13. END $$
  14.  
  15. DELIMITER ;
Add Comment
Please, Sign In to add comment