dimanche 5 avril 2015

Counting the number of rows that have a particular word in a column of blob data type in mysql

I have a table like this in mysql. The datatype of column 'file' is blob. I need to count the number of rows which have the word 'lumia' in column 'file' and 'display' in column 'attribute'. That is, here the rows 1 and 3. so the output has to be 2. How can i do that in mysql?


The multiple occurrence of the word lumia in 3rd row need not be counted twice.



+------+----------------------------+------------+
| slno | file | attribute |
+------+----------------------------+------------+
| 1 | 5inch 8mp lumia snapdragon | display |
|
| 2 | 8mp galaxy samsung android | camera |
|
| 3 | nokia lumia red lumia | display |
|
| 4 | black samsung 8mp android | camera |
|
| 5 | lumia windows 8mp red | model |

Aucun commentaire:

Enregistrer un commentaire