Trying to get the word with initial uppercase in the first letter using mysql

I have

Visit table Visit_Id Visit_Date values(09-09-2011) Visit_status values like (accepted , refused) member_Id 

I made it so that I get the number of visits using the query below

 SELECT visit_Status as Status, COUNT('x') AS Visits FROM visits WHERE visit_Date BETWEEN '2011-06-20' AND '2011-07-20' GROUP BY visit_Status 

he cited results like this

  Status Visits accepted 2 refused 4 

Can i get results like this

  Status Visits Accepted 2 Refused 4 with upper case letter on first letter of status i mean like this ( Accepted , Refused) instead of this one (accepted , refused) 

I am using mysql desktop

+4
source share
3 answers

u can use SUBSTRING and UPPER

 select CONCAT(UPPER(SUBSTRING(visit_Status, 1, 1)), LOWER(SUBSTRING(visit_Status FROM 2))) as Status ...... 
+6
source

This will do what you want:

 SELECT CONCAT(UPPER(SUBSTRING(Visit_status, 1, 1)), LOWER(SUBSTRING(Visit_status FROM 2))) AS Status COUNT('x') AS Visits FROM visits WHERE visit_Date BETWEEN '2011-06-20' AND '2011-07-20' GROUP BY visit_Status 
+2
source
 SELECT CONCAT(UPPER(SUBSTRING(Visit_status, 1, 1)), SUBSTRING(Visit_status FROM 2)) as Status, COUNT('x') AS Visits FROM visits WHERE visit_Date BETWEEN '2011-06-20' AND '2011-07-20' GROUP BY visit_Status 
+1
source

All Articles