Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: Grouping records using decode
"Smith, Ron L." wrote:
>
> I have a table containing rows with date and time. I would like to combine
> rows based on the quarter hour. Rows in the first 15 minutes would be in
> the first group, the second fifteen minutes in the second, and so on. Does
> anyone know how to do this?
>
> Thanks!
> Ron
> --
>
Misleading topic: you are suggesting a solution which is not the good one. Why do you want a decode() ?
select trunc((a.date_value - b.min_date) * 14400 / 15), <group function>
from your_table a, (select min(date_value) min_date from your_table) b where .. group by trunc((a.date_value - b.min_date) * 14400 / 15)
-- Regards, Stephane Faroult Oriole Corporation Voice: +44 (0) 7050-696-269 Fax: +44 (0) 7050-696-449 Performance Tools & Free Scripts -------------------------------------------------------------- http://www.oriole.com, designed by Oracle DBAs for Oracle DBAs -------------------------------------------------------------- -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Stephane Faroult INET: sfaroult_at_oriole.com Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).Received on Tue Jul 24 2001 - 17:58:40 CDT
![]() |
![]() |