Reputation: 83
This question is about MySQL Query. I have three tables:
I want to count how many words in 'text' with the word which is already determined in 'word'. Then the result is stored in 'score'. This is my code:
UPDATE englishkeywordmodel
SET score=(SELECT COUNT(*)FROM brand WHERE text LIKE (SELECT word FROM englishkeyword WHERE ID=2 LIKE ('%', word, '%')))
WHERE ID=2;
I got this error:
I say many thanks for answer!
Upvotes: 1
Views: 384
Reputation: 6661
Use LIMIT
because Your subquery is selecting two or more columns
SELECT word FROM englishkeyword WHERE ID=2 AND Column LIKE
CONCAT('%', word ,'%') limit 1
Upvotes: 2