List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:September 19 2002 1:31am
Subject:Re: sum column in mysql
View as plain text  
At 10:32 +0300 9/18/02, adi wrote:
>  Hi, I have a table table1, with a column "Duration" time type(ex 00:12:30)
>I want to make a sql selection:
>SELECT * from table1 WHERE condition, and after that, to make sum of values
>of column "Duration" and display it.
>Any Help?
>tx

To display as seconds:

SELECT SUM(TIME_TO_SEC(Duration)) FROM table1 ...

To display as a TIME value:

SELECT SEC_TO_TIME(SUM(TIME_TO_SEC(Duration))) FROM table1 ...
Thread
sum column in mysqladi18 Sep
  • Re: sum column in mysqlThomas Seifert18 Sep
  • Re: sum column in mysqlPaul DuBois19 Sep