做外链接,并且左侧表按照一定条件查询的情况
SELECT *
FROM table1 as lm
left join table2 as lb
ON lm.id = lb.materialsId
where lm.type = ? OR lm.type=? AND lb.userId = ?
order by lm.id
desc LIMIT ?,?
查询结果某一项添加自定义字符串的情况
SELECT concat('会员',dataName) dataName FROM `table1` WHERE 1