sql数据库关联查询语句、连表查询LEFT JOIN

我来纠错
//用法1,用join:根据表the2的id和表the2_pic的parentid相等,并且the2_pic的iscover是1,取表2的src
$sql = "select the2.*,the2_pic.src from the2 LEFT JOIN the2_pic ON the2.id=the2_pic.parentid and the2_pic.iscover=1 order by the2.time";

//用法2,用where:
$sql = "select the2.*,the2_pic.src from where the2.id=the2_pic.parentid order by the2.time";

发送
热门关键词:
命令
知识类型:
标题描述:
详细解答:

提交审核您编辑的知识会经过 前端大牛 人工审核。