I have below table.
CREATE TABLE IF NOT EXISTS `product`
(
`id` int(11) NOT NULL,
`name` varchar(200) COLLATE utf8_unicode_ci NOT NULL,
`description` varchar(200) COLLATE utf8_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
INSERT INTO `product` (`id`, `name`, `description`) VALUES
(1, 'Samsung', "this is samsung product description from samsung"),
(2, 'Mobile', "Samsung galaxy note2 from samsung store"),
(3, 'Smartphone', "Samsung");
now i want to query on product
table that produce result as below.
ID Name WordCount
1 Samsung 3
2 Mobile 2
3 Smartphone 1
how can i count this word occurrence in MySQL
select query.
EDIT
Sorry for not clearing my point.
But here it is.
I want to search
word Samsung
from all the rows and count its occurrence not only from name but from also description too.