Re: I need a SQL... - Mailing list pgsql-general

From Adam Kavan
Subject Re: I need a SQL...
Date
Msg-id 5.2.1.1.0.20030911140658.00ab3a00@pop.central.cox.net
Whole thread Raw
In response to Re: I need a SQL...  (Bjørn T Johansen <btj@havleik.no>)
List 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 by date:

Previous
From: "Duffey, Kevin"
Date:
Subject: Re: how to replicate database
Next
From: Sean Chittenden
Date:
Subject: Re: State of Beta 2