5 Useful MySQL Functions And Control Flows
1: IF()
If statements have been a life saver on many occasions. They are invaluable for checking a value then returning another value different from the one stored in the table.
sql Code:
SELECT
IF(myColumn1 = 1, ‘Yes’, ‘No’) AS myIfColumn
FROM
myTable
Result: If myColumn1 equals 1 then Yes else No.
2: ELT()
Similar to an if else statement. The ELT takes the [...]