Hi all,
I've tried looking through the old posts/MYSQL documentation and the search but I’m still unsure how to do this, if its even possible through a MYSQL query (w/ using joins).
The data I’m working with will always be either '0' or '1', I wanted to return in my MYSQL output either 'Active' or 'Non-Active' based on that field, rather than '0' or '1'
It’s not a major problem since I can do this through the PHP code if necessary (as I would normally do)
But I was thinking if I could simply replace the value in the MYSQL query it would be more efficient, and without using a join and an extra table to store the 2 results.
At the moment I have tried using the replace command, and I had it replacing '1' with Active (replace(player_status, '1', 'active') AS status) but couldn't get it replacing '0' with 'Non-Active' on the same field since it would fail if not 0 and output for status would be ‘1’, is there a better suited command for this?
Thanks in advance.