Jump to content

ORDER BY (manually)


miffe

Recommended Posts

Lets say I have a field called operation which holds values like (/,+,- and *) but as it has no id tag or index, and I don't want to make another table with the order of operations... is it possible to do a manual ORDER BY specifying which one goes first, then next, etc. ?thanks- miffe

Link to comment
Share on other sites

Not that I am aware of. I've been forced to either add a new table or insert another column in my existing table:

operator	 precedence*				1/				2+				3-				4

SELECT operator FROM myTable ORDER BY precedence ASC

Link to comment
Share on other sites

Not that I am aware of. I've been forced to either add a new table or insert another column in my existing table:
operator	 precedence*				1/				2+				3-				4

SELECT operator FROM myTable ORDER BY precedence ASC

mhhhh oooook, its just that ive already got more than 45 tables in my DB and didn't want to add another one...I might instead better just do the sorting manually with php code ^^ that should work right?
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...