I need to sort the output of my SQL query...
Posted: Thu Mar 06, 2003 10:51 pm
Okay I need to sort the output of my SQL query... however, I need to do it weridly (yes that's a word as of now
).
What I am doing is building a small inventory system for a tux rental place a friend owns. Let's say he's got 6 coats in stock of different sizes, here's an example of what it would look like now if I just do a normal sort by size:
Now, it's quite simple what I need to do. I need the output of my SQL query pulling info from the table that has the differnet coats in it to be sorted by size (from smallest to biggest), not by alphabetical. Here's how it should sort:
See how short it on the top, and it goes down through extra-long? Also, notice boys is on top, not on the bottom.
How can I do this?
Someone on IRC suggested I split apart the letter and number... like one feild for 38, one for S... but the problem is there are over 600 coats in the table now, so that'd be a pain to go through and redo, plus, boys would still be on the bottom unless I inverted the list, then it'd all be upside-down.
Any ideas??
-ee99ee
What I am doing is building a small inventory system for a tux rental place a friend owns. Let's say he's got 6 coats in stock of different sizes, here's an example of what it would look like now if I just do a normal sort by size:
Code: Select all
38L
38R
38S
38XL
B12
B8
Note: S = Short, R = Regular, L = Long, XL = Extra-Long, B = BoysCode: Select all
B8
B12
38S
38R
38L
38XLHow can I do this?
Someone on IRC suggested I split apart the letter and number... like one feild for 38, one for S... but the problem is there are over 600 coats in the table now, so that'd be a pain to go through and redo, plus, boys would still be on the bottom unless I inverted the list, then it'd all be upside-down.
Any ideas??
-ee99ee