Re: SQL syntax

From: Jean-Luc Lachance <jllachan(at)nsd(dot)ca>
To: frederic massot <frederic(at)juliana-multimedia(dot)com>, pgsql-sql(at)postgresql(dot)org
Subject: Re: SQL syntax
Date: 2002-08-06 17:53:50
Message-ID: 3D500D2E.16195BAB@nsd.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Can someone *pleaaaaase* temporarely remove

"Bob Powell" <Bob(at)hotchkiss(dot)org>

from the list so we do not get a vacation message for every message one
posts.

Jean-Luc Lachance wrote:
>
> Try:
>
> Order by mod( id_mois + 12 - <current_month>, 12)
>
> frederic massot wrote:
> >
> > Hello,
> >
> > I have a table containing the months of the year :
> >
> > travail=> select * from mois order by id_mois;
> >
> > id_mois|mois_fr |mois_en |mois_de
> > -------+---------+---------+---------
> > 1|Janvier |January |Januar
> > 2|Fevrier |February |Februar
> > 3|Mars |March |Marz
> > 4|Avril |April |April
> > 5|Mai |May |Aber
> > 6|Juin |June |Juni
> > 7|Juillet |July |Juli
> > 8|Aout |August |August
> > 9|Septembre|September|September
> > 10|Octobre |October |Oktober
> > 11|Novembre |November |November
> > 12|Decembre |December |Dezember
> > (12 rows)
> >
> > And I try to obtain for one month given (for example August : 8) two
> > previous months, the current month, and nine next months :
> >
> > id_mois|mois_fr |mois_en |mois_de
> > -------+---------+---------+---------
> > 6|Juin |June |Juni
> > 7|Juillet |July |Juli
> > 8|Aout |August |August
> > 9|Septembre|September|September
> > 10|Octobre |October |Oktober
> > 11|Novembre |November |November
> > 12|Decembre |December |Dezember
> > 1|Janvier |January |Januar
> > 2|Fevrier |February |Februar
> > 3|Mars |March |Marz
> > 4|Avril |April |April
> > 5|Mai |May |Aber
> >
> > Do you see how making in a SQL request ?
> >
> > Thank you.
> > --
> > ==============================================
> > | FREDERIC MASSOT |
> > | http://www.juliana-multimedia.com |
> > | mailto:frederic(at)juliana-multimedia(dot)com |
> > ===========================Debian=GNU/Linux===
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 1: subscribe and unsubscribe commands go to majordomo(at)postgresql(dot)org
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Josh Berkus 2002-08-06 18:35:20 Re: problem fetching currval of sequence
Previous Message Jean-Luc Lachance 2002-08-06 17:38:25 Re: SQL syntax