maps filter fodder: MySQL
> Hi Terence, > > > Is there a way to sort records based on a particular column, varchar(3), > > which contains days of the week, mon, tue, wed, thu, fri, sat, sun > > > > I need the order to be mon, tue, wed, thu etc. > > > > Select day_of_week from my_timetable > > order by day_of_week > > > > Gives > > > > >fri > > >mon > > >sat > > >sun > > >thu > > >tue > > >wed > > > > Is is possible? > > > You could consider encoding day data within the tables as numerics 0~6 or > 1~7, and then use SET operations within SELECT to convert to text/abbrevns. > Alternatively put both alpha and num info in the table, quoting from one and > ordering on the other... > > Take a look at the manual's Date-time Functions page for ideas. > > Regards, > =dn > --------------------------------------------------------------------- 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 <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php