1、mysql中使用CONCAT来连接字符,可以将几段字符连接在一起,CONCAT(string1,string2,string3)
2、LEFT(string,int)和SUBSTRING(string,int)是取得字符串的部分数组,两者不同的是,left是从最左边开始,一共取得int个字符;而substring则是从int的位置开始一直到最后的字符串。
# Write your MySQL query statement below
select user_id,
CONCAT(Upper(left(name,1)),Lower(substring(name,2))) name
from users
order by user_id
select sell_date,
count(distinct product) num_sold,
GROUP_CONCAT(distinct product) products
from activities
group by sell_date
order by sell_date
SELECT patient_id, patient_name, conditions from patients
where conditions like 'DIAB1%' or conditions like '% DIAB1%'