Good Day everyone,
I need help in using the result of my if and else satement as a variable in the mysql query below:
SELECT type, description, IF(type = 'Fixed Assets', 'true', 'false') AS description, IF(description = description, 'true', 'false') AS description2 FROM table_name;
What I need is to use the result of 'description' as a condition in another column which is 'description2', so that I won't use the same IF and else statement of 'description 'over and over again.
The expected result for description is 'true', and the expected result for description2 is 'true' as well because the value for description = 'true'.
Any answers will be a good help, thank you.
Aucun commentaire:
Enregistrer un commentaire