From: Neil Tompkins
Date: October 28 2013 6:06pm
Subject: Update Column in table only if variable is Not NULL
List-Archive: http://lists.mysql.com/mysql/229905
Message-Id:
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary=047d7bf10aa809e5df04e9d0f431
--047d7bf10aa809e5df04e9d0f431
Content-Type: text/plain; charset=ISO-8859-1
Hi
If I have a update statement like
UPDATE MY_TABLE
SET FieldName1 = Now(), FieldName2 = :MyVariable
WHERE FieldName3 = 'Y'
How can I only update the FieldName2 field if the value of MyVariable is
NOT NULL ?
Thanks
Neil
--047d7bf10aa809e5df04e9d0f431--