Communities for your favorite technologies. Explore all Collectives
Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work.
Bring the best of human thought and AI automation together at your work. Learn more
Find centralized, trusted content and collaborate around the technologies you use most.
Stack Internal
Knowledge at work
Bring the best of human thought and AI automation together at your work.
Hello I want to update field value where Field have NULL value i am using
UPDATE video SET like = 0 WHERE like IS NULL;
but it's not working . can any one help me ?
like
NULL
empty string
..WHERE like IS NULL OR like = ''
like is a keyword in SQL. e.g. where textcolumn like "%TEST%"
where textcolumn like "%TEST%"
So you'll have to escape it, if you're using it as a column name.
Try can this:
update video set `like` = 0 where `like` is null
Add a comment
Try this query, May be your the value of like is empty string or a spacebar.
UPDATE video SET like = 0 WHERE like IS NULL OR like ='' OR like = ' ';
Required, but never shown
By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.
Start asking to get answers
Find the answer to your question by asking.
Explore related questions
See similar questions with these tags.
likeis notNULL. might beempty stringTry this instead :..WHERE like IS NULL OR like = ''likeis a reserved word. Enclose it by backtick while using