Consider the following query:
SELECT operation, [...] FROM tableName
The operation field will retrieve an integer from 1 to 4. What I would like to do is assign a string value to a variable in the SQL query, based on the integer value of operation.
If it were up to me, I would have a corresponding table that contained the name of each operation, in which case a JOIN would pick up the operation string. Unfortunately, I do not control the database.
I don’t know if this is even something SQL can do, and I could certainly iterate over the returned data using PHP to perform this task instead, but it makes sense to do it all in one hit if possible.
Try something kile this: