Re: MySql week() method equivalent

From: "Greg Sabino Mullane" <greg(at)turnstep(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: MySql week() method equivalent
Date: 2010-11-18 15:16:31
Message-ID: 6c52b9e430cd98a630fe2246b83c86c6@biglumber.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice


-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160

> select week(date,3). Based on mysql site, second parameter means that
> "Week 1 is the first week with more than 3 days this year(for second parameter=3)"

There is nothing directly compatible in Postgres: we only deal with
the ISO 8601 standard of a week. You would need to write your own
function to emulate it completely. It might be worth checking some
of the mysql compatibility projects to see if someone has already
done so.

- --
Greg Sabino Mullane greg(at)turnstep(dot)com
End Point Corporation http://www.endpoint.com/
PGP Key: 0x14964AC8 201011181015
http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8
-----BEGIN PGP SIGNATURE-----

iEYEAREDAAYFAkzlQzIACgkQvJuQZxSWSshYVQCg7+ROonN9D9NBYrDOAk0GEc2U
IJcAoJvJfEBI2LNKovpMfegzwyVYh69v
=kMe1
-----END PGP SIGNATURE-----

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Tom Lane 2010-11-18 15:36:21 Re: Debugging PostgreSql queries
Previous Message Vaduvoiu Tiberiu 2010-11-18 13:07:59 MySql week() method equivalent