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 <btj@havleik.no>)
Список pgsql-general
>
>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