[SQL] How to get the previous date?
Hi, I'm using Enterprise DB PostgresPlus version 8.3. Is there is a simple function or command like previous_date(mydate) which when passed a particular date, simply returns the previous date? I tried mydate - 1 but this doesnt work. Thanks, Shruthi
Re: [SQL] How to get the previous date?
Hello. current_date - 1 is the solution. 2009/10/14 Shruthi A > Hi, > > I'm using Enterprise DB PostgresPlus version 8.3. > Is there is a simple function or command like previous_date(mydate) which > when passed a particular date, simply returns the previous date? I tried > > mydate - 1 > > but this doesnt work. > > Thanks, > Shruthi
Re: [SQL] How to get the previous date?
Helo Madam, Here is the query. select now()+ interval '-1 day ' Regards, ram - Original Message - From: Shruthi A To: pgsql-sql@postgresql.org Sent: Wednesday, October 14, 2009 3:10 PM Subject: [SQL] How to get the previous date? Hi, I'm using Enterprise DB PostgresPlus version 8.3. Is there is a simple function or command like previous_date(mydate) which when passed a particular date, simply returns the previous date? I tried mydate - 1 but this doesnt work. Thanks, Shruthi
[SQL] How to order varchar data by word
Hello, list. I have a table with a varchar field that I would like to order by word, not by ordinal, which seems to be the default on postgres. Does anyone have a clue on how this can be done? Many thanx in advance, Best, Oliveiros
Re: [SQL] How to get the previous date?
Try this: select cast(mydate as date) -1 > Hi, > I'm using Enterprise DB PostgresPlus version 8.3. > Is there is a simple function or command like previous_date(mydate) which > when passed a particular date, simply returns the previous date? I tried > mydate - 1 > but this doesnt work. > Thanks, > Shruthi Почта со встроенным плеером находится здесь: http://mail.yandex.ru/promo/new/wysiwyg -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql
Re: [SQL] How to order varchar data by word
On Wednesday 14 October 2009 7:13:22 am Oliveiros C, wrote: > Hello, list. > > I have a table with a varchar field that I would like to order by word, not > by ordinal, which seems to be the default on postgres. > > Does anyone have a clue on how this can be done? > > Many thanx in advance, > > Best, > Oliveiros Can you show the SQL you are using? -- Adrian Klaver akla...@comcast.net -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql