Subject Re: [firebird-support] Ignore Seconds when getting unique list of times
Author Helen Borrie
At 12:42 PM 1/08/2007, you wrote:
>I want a list of the unique times in a time field, but I don't want
>the seconds considered. When I try SELECT (DISTINCT) it takes the
>seconds in account. How can I get the query to ignore them?

You'll need to use an expression, using the EXTRACT() function:


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 ...