Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: group by for column of type date
Niall Litchfield wrote:
[..]
> The original question was about grouping by date. Group by
> trunc(date_column) will group all rows from the same day together, it is
> more efficient (for the reasons Alex gives though I do wonder how big the
> performance impact actually is), Your test seems just to show that the
> *presentation* of the date is different dependent upon NLS_LANG.
yes, but that's my problem. when i want to use TRUNC in the GROUP BY clause I also have to use it in the SELECT clause which I can't do. i have to traverse the result in my host lauguage PHP4. the problem is that not for each day exists an entry so i have to generate all dates using php4 and then compare them to the result of the database. I think that this has higher performance than firing an sql-statement for each day.
so it seems that i have to use TO_CHAR although it is slow and so on. ... or is there a way to set NLS_LANG at runtime for the session?
-- mac real email-adress: mac clondiag comReceived on Thu Nov 28 2002 - 01:28:49 CST