Re: I need a SQL...

Поиск
Список
Период
Сортировка
Искать
От
Adam Kavan
Тема
Re: I need a SQL...
Дата
Msg-id
5.2.1.1.0.20030911140658.00ab3a00@pop.central.cox.net
Ответ на
Re: I need a SQL... (Bjørn T Johansen)
Список
Дерево обсуждения
I need a SQL... Bjørn T Johansen <btj@havleik.no>
Re: I need a SQL... "Andrew L. Gould" <algould@datawok.com>
Re: I need a SQL... Bjørn T Johansen <btj@havleik.no>
Re: I need a SQL... Adam Kavan <akavan@cox.net>

>
>Yes, the period can exceed 12 hours, so what you are saying is that this 
>is not possible to solve without the date part? I can write this logic in 
>my business logic but I was hoping to solve this in my database layer... BTJ


How about SELECT CASE WHEN "StartTime" > "EndTime"  THEN 
'23:59:99.99999999999'::time - "StartTime" + "EndTime" ELSE 
"EndTime"-"StartTime" END FROM "TimeTable";

--- Adam Kavan
--- akavan@cox.net


В списке pgsql-general по дате отправления
От: Duffey, Kevin
Дата:
Сообщение: Re: how to replicate database
От: Sean Chittenden
Дата:
Сообщение: Re: State of Beta 2
FAQ