Mysql Query to count common number in a column

Multi tool use
Multi tool use
The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP


Mysql Query to count common number in a column



I have a main table as first image and I need to produce output as second table. Can any one please help me to do mysql query.
Main Table



Output




1 Answer
1



You can do :


select anumber,
sum(tsp = 'aplace') as aplace,
sum(tsp = 'bplace') as bplace,
sum(tsp = 'cplace') as cplace
from table t
group by anumber;






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

nL,R,Wh6xU,SIY02NePz2VgCyq,uT
JybFUUmYGWN3

Popular posts from this blog

Makefile test if variable is not empty

Visual Studio Code: How to configure includePath for better IntelliSense results

Will Oldham