• I removed the www from the URL, please update your bookmarks and pay attention to the bottom of the screen if using Google Chrome to allow push notifications again.

before comma total row count

ulaskayalar

New member
Joined
Apr 14, 2019
Messages
1
Programming Experience
1-3
Hello there,

I need to find the total number of data with MYSQL, but the data I store is not like standard data. As an example, before comma 'ahmet', how many are there in this column?

ID NAME
1 ahmet, mehmet, ayse, tugce
2 mehmet, fatih, ayse, tugce
3 ahmet, mehmet, furkan, tugce
4 kaan, ali, tugce, ahmet

I want to find a total of 'ahmet' data. There are 3 Ahmet in the column NAME. How can I find?
 

JuggaloBrotha

Moderator
Staff member
Joined
Apr 23, 2011
Messages
152
Location
Lansing, MI; USA
Programming Experience
10+
Would the same word appear more than once per line?
For example: would "ahmet" appear more then once per record?

If not, then the easiest way would be to do a Count() query with a where clause that uses a like, such as:
Code:
Select Count(*) As Count
From YourTable
Where NAME Like '%YourWord%'
Your example would be:

Code:
Select Count(*) As Count
From YourTable
Where NAME Like '%ahmet%'
 
Top Bottom