| SQL - Questions and Answers Have a SQL question? Post it here. First do a search to see if someone hasn't already answered it. |
|
|||
|
Yes you can do that.
Here is an example that will check wether a colum "is_valid", which stores an integer value of 1 (for YES) or 0 for (NO), is valid or not and return the string YES or NO accordingly.
SELECT In your case you just want to check if the a column (say "test_column") has a value or not so it will look something like:
SELECT,The column "test_column" must be NOT NULL. If it allows NULLs you could check for that:
IF(test_column IS NULL, 'FALSE', IF(test_column = '', 'FALSE', 'TRUE')) AS test_column |