SELECT Num,timestampdiff(Minute,'2011-05-30T10:00:00','2011-05-30T10:15:00') as DifUno,
timestampdiff(Minute,'2011-05-30T15:00:00','2011-05-30T14:50:00')as DifDos,
timestampdiff(Minute,'2011-05-30T18:00:00','2011-05-30T18:00:00') as DifTres
FROM MiTabla where Num = 8 and campo_fecha > current_date;
que me envia la diferencia de minutos hasta aquí todo bien
Código:
yo quisiera al final mostrar un campo con el total algo asiNum DifUno DifDos DifTres 8 15 -10 0
Código:
pero si hago esto asiNum DifUno DifDos DifTres Total 8 15 -10 0 5
SELECT Num,timestampdiff(Minute,'2011-05-30T10:00:00','2011-05-30T10:15:00') as DifUno,
timestampdiff(Minute,'2011-05-30T15:00:00','2011-05-30T14:50:00')as DifDos,
timestampdiff(Minute,'2011-05-30T18:00:00','2011-05-30T18:00:00') as DifTres, (DifUno + DifDos + DifTres) as Total
FROM MiTabla where Num = 8 and campo_fecha > current_date;
obvio me marca error porque no tengo los campos en la tabla 'DifUno,DifDos etc..'
hay alguna manera de sacar eso el total de la diferencia??