1、left join on 多条件

SELECT * FROM product LEFT JOIN product_details
ON (product.id = product_details.id)
WHERE product.amount=200;

2、字符串链接

CONCAT(string1,string2,…)
CONCAT_WS(separator,str1,str2,...)

3、行变列

group_concat(name)

select id,group_concat(name) from aa group by id;
select id,group_concat(name separator ';') from aa group by id;
select id,group_concat(distinct name) from aa group by id;
select id,group_concat(name order by name desc) from aa group by id;

4、EXISTS
SELECT FROM article WHERE EXISTS (SELECT FROM user WHERE article.uid = user.uid)