I'm trying to run CONCAT on a column with fields that may or may not be empty. If the field isn't empty, there is no problem, i.e. if field in coulmn A equals a:
SET A = CONCAT(A, '_b')
gives a_b. The problem is, if the field in column A is empty, the concat returns nothing. Is there a way for it to concatenate even if the field is empty, which, in this example, would return '_b'?
In Sql server
SET A = CONCAT(isnull(A,''), '_b')
Use IFNULL in Mysql.
Refer different function as per different database
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With