Sorry, but this examples not use index.

On 1/7/11, Susanne Ebrecht <susa...@2ndquadrant.com> wrote:
> Hello Thomas,
>
> On 05.01.2011 20:39, Good, Thomas wrote:
>> select * from db_log where log_date LIKE '2011-01-%';
>
> The lazy way would be something like this:
> SELECT * from tab WHERE log_date::VARCHAR LIKE '2011-01-%';
>
> The more proper way is:
>   SELECT * from tab WHERE EXTRACT(YEAR FROM log_date) = 2011 and
> EXTRACT(MONTH FROM log_date) = 1;
>
> Susanne
>
> --
> Susanne Ebrecht - 2ndQuadrant
> PostgreSQL Development, 24x7 Support, Training and Services
> www.2ndQuadrant.com
>
>
> --
> Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-sql
>

-- 
Sent from my mobile device

------------
pasman

-- 
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql

Reply via email to