Hans Andersen
Hans Andersen

Reputation: 15

problems with group by function

I'm having a little problem. I'm trying to get a date into my table, but an error occurs when trying running it. I have googlet the error end tried som solutions, but none of them worked. Before adding the date to the Select clause, it worked fine.

Select Postal_Code, Sum(Letters), To_Char(trunc(Start_time),'DD-MM-YYYY') AS StartTime
    from Table_name    
    Group by Postal_Code

As you can see, im trying to select the date. I dont know how to make it work. I'm new to this.

Upvotes: 0

Views: 44

Answers (1)

RichardTheKiwi
RichardTheKiwi

Reputation: 107716

To group by Postal_code per day:

Select Postal_Code, Sum(Letters), To_Char(Start_time,'DD-MM-YYYY') AS StartTime
from Table_name    
Group by Postal_Code, To_Char(Start_time,'DD-MM-YYYY')

Upvotes: 3

Related Questions