php - Count how many times a string appears in a mysql table -


i have big database stores data form. answers of form yes or no, in database there 62 names of questions stored answers (yes or no) , uid. need count how many times yes , no appears , store in variable. how can this? example of stored data this: tl1a->yes , tl2a->no , ..., uid->1234

just example ...

select      *,         round (            (             length(`yourfield`)             - length( replace ( `yourfield`, "yes", "") )          ) / length("yes")             ) count     `yourtable` 

in same manner "no"

hope work...


Comments

Popular posts from this blog

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -

javascript - oscilloscope of speaker input stops rendering after a few seconds -