Not sure how far sql can work with if / else statements.
I have a simple SELECT statement:
SELECT amount , transtype FROM transactions
The transtype column will be a number.
For example, 1 = sale, 2 = return, 3 = error, 4 = canceled, 5 = something else .... etc.
So, nothing complicated. But the list is usually growing for reporting reasons. What well.
For the particular query I'm working on, is there a way to extract this column as one of two or three specified numbers or text?
For example, some transistor numbers are βloss,β others are βgain,β and others are βneutral.β
I would like to extract this column with only these 3, not using php inside the html table. I throw the lines in.
If my explanations are not clear, my apologies. It was hard to spit it out.
mysql if-statement
coffeemonitor
source share