Subject | Re: [firebird-support] Ignore Seconds when getting unique list of times |
---|---|
Author | Helen Borrie |
Post date | 2007-08-01T03:51:19Z |
At 12:42 PM 1/08/2007, you wrote:
e.g.
select distinct (
extract (HOUR from aTime) || ':' ||
case WHEN (extract (MINUTE FROM aTime) < 10) THEN
'0' || extract (MINUTE FROM aTime)
ELSE extract (MINUTE from aTime END ) as HoursMinutes
from ...
>I want a list of the unique times in a time field, but I don't wantYou'll need to use an expression, using the EXTRACT() function:
>the seconds considered. When I try SELECT (DISTINCT) it takes the
>seconds in account. How can I get the query to ignore them?
e.g.
select distinct (
extract (HOUR from aTime) || ':' ||
case WHEN (extract (MINUTE FROM aTime) < 10) THEN
'0' || extract (MINUTE FROM aTime)
ELSE extract (MINUTE from aTime END ) as HoursMinutes
from ...