Re: Substring Problem - Mailing list pgsql-general

From Tino Wildenhain
Subject Re: Substring Problem
Date
Msg-id 4829A96F.4060207@wildenhain.de
Whole thread Raw
In response to Re: Substring Problem  (<ludwig@kni-online.de>)
Responses Re: Substring Problem
List pgsql-general
ludwig@kni-online.de wrote:
> Type casting is required since 8.3, try
>
> SELECT substring(date :: varchar from 1 for 7) AS stryearmonth,
                      ^^^^^^

sorry but this hurts and should not recommended. I think depesz
approach with to_string() and the correct format string is the
better solution. (think of datetyle oddities) - one of the reasons
I believe most of the implicit casts have gone ayway.

> COUNT(id) AS countofnumber FROM (SELECT * from downloads ) AS foo GROUP
> BY stryearmonth ORDER BY stryearmonth ASC

btw, whats the reason for the subselect?

T.


Attachment

pgsql-general by date:

Previous
From: "Joshua D. Drake"
Date:
Subject: Re: PG -v- MySQL
Next
From: Alvaro Herrera
Date:
Subject: Re: Making sure \timing is on