sql - Update query needed based on the condition -


i need stored procedure update error message column on table based on condition, if dob null or greater current date error message column should updated 'invalid dob' , based on id has updated, if dob lesser current date , not null, error message column should not updated. need update statement query, tried update columns without checking condition. please provide solution query,thank you.

strange requirement simple.

update sometable set errormessage = 'invalid dob' dob null or dob > getdate() 

Comments

Popular posts from this blog

Java 8 + Maven Javadoc plugin: Error fetching URL -

android - How to delete or change the searchview icon inside the SearchView actionBar? -

c++ - Msgpack packing bools bug -