Check out example codes for "if inside select mysql". It will help you in understanding the concepts better.

Code Example 1

SELECT IF(1>3,'true','false');

Learn ReactJs, React Native from akashmittal.com