List:General Discussion« Previous MessageNext Message »
From:Peter Sampson Date:May 15 2002 9:06pm
Subject:Fw: Simple SQL
View as plain text  
 So i change the properties of Month to Integer in tblNews?

 Create another table called MonthNames? Now I'm lost a bit, please can you
 clarify?

 I can populate the MonthNames table with jan feb march etc....

 Please can you clarify the next bit, I not familar with n JOIN .... ON n
Month?


> ----- Original Message -----
> From: Gabriel <gabriel@stripped>
> To: Peter Sampson <frontpages@stripped>
> Sent: Wednesday, May 15, 2002 8:32 PM
> Subject: Re: Simple SQL
>
>
> > Change the way you do your months.  Instead of entering each month, you
> > could do it this way:
> >
> > Change tblNews.Month to an integer, and add this table:
> >
> > CREATE TABLE MonthNames ( month int not null primary key, month_name
> > char(32) );
> >
> > Populate the MonthNames table, and then your query could become this:
> >
> > SELECT DISTINCT mn.month_name FROM tblNews n JOIN MonthNames
> > ON n.Month = mn.month ORDER BY mn.Month ;
> >
> > Or something like that.
> >
> > Enjoy,
> > Gabriel.
> >
> >
> > Peter Sampson wrote:
> > > SQL beginner using Macromedia Ultradev. Can you help?
> > >
> > > Please be gentle I'm not  a programmer!
> > >
> > > I am using
> > >
> > > Select DISTINCT Month
> > > FROM tblNews
> > >
> > > The problem is that the months are shown alphabetical not in calendar
> order.
> > >
> > > How can I change this?
> > >
> > >
> > > ---------------------------------------------------------------------
> > > Before posting, please check:
> > >    http://www.mysql.com/manual.php   (the manual)
> > >    http://lists.mysql.com/           (the list archive)
> > >
> > > To request this thread, e-mail <mysql-thread109148@stripped>
> > > To unsubscribe, e-mail
> <mysql-unsubscribe-gabriel=dialupusa.net@stripped>
> > > Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
> > >
> > >
> > >
> >
> >
> > --
> > Gabriel Cain
> > Unix Systems Administrator           gabriel@stripped
> > Dialup USA, Inc.                      888-460-2286 ext 208
> >
>

Thread
Fw: Simple SQLPeter Sampson15 May
  • Re: Fw: Simple SQLGabriel15 May