标签:sel 字段名 and HERE sele 关联表 字段 order by 记录
select `数据表.字段1`, group_concat(`数据表.字段2`) from `数据表` group by `数据表.字段1` order by `数据表.字段1` desc;
select * from `数据表名称` group by `字段名称1`,`字段名称2`;
select `数据表.字段名称`, `关联表.字段名称` from `数据表名称` inner join `关联表名称` on `数据表.主键`=`关联表.外键`;
select `数据表.字段名称`, `关联表.字段名称` from `关联表名称` inner join `数据表名称` on `数据表.主键`=`关联表.外键`;
select `数据表.字段名称`, `关联表.字段名称` from `数据表名称`, `关联表名称` where `数据表.主键`=`关联表.外键`;
select `数据表.字段名称`, `关联表1.字段名称`, `关联表2.字段名称` from `数据表` inner join `关联表1` on `数据表.主键`=`关联表1.外键` inner join `关联表2` on `数据表.主键`=`关联表2.外键`;
select `数据表.字段名称`, `关联表1.字段名称`, `关联表2.字段名称` from `数据表`, `关联表1`, `关联表2` where `数据表.主键`=`关联表1.外键` and `数据表.主键`=`关联表2.外键`;
select `数据表.字段名称`, `关联表.字段名称` from `数据表名称` left join `关联表名称` on `数据表.主键`=`关联表.外键`;
select `数据表.字段名称`, `关联表.字段名称` from `关联表名称` right join `数据表名称` on `数据表.主键`=`关联表.外键`;
select `数据表.字段名称`, `关联表.字段名称` from `数据表名称` left join `关联表名称` on `数据表.主键`=`关联表.外键` where `关联表.主键` is null;
select `数据表.字段名称`, `关联表.字段名称` from `关联表名称` right join `数据表名称` on `数据表.主键`=`关联表.外键` where `关联表.主键` is null;
select `数据表.字段名称`, `关联表.字段名称` from `数据表名称` right join `关联表名称` on `数据表.主键`=`关联表.外键`;
select `数据表.字段名称`, `关联表.字段名称` from `关联表名称` left join `数据表名称` on `数据表.主键`=`关联表.外键`;
select `数据表.字段名称`, `关联表.字段名称` from `数据表名称` right join `关联表名称` on `数据表.主键`=`关联表.外键` where `数据表.主键` is null;
select `数据表.字段名称`, `关联表.字段名称` from `关联表名称` left join `数据表名称` on `数据表.主键`=`关联表.外键` where `数据表.主键` is null;
标签:sel 字段名 and HERE sele 关联表 字段 order by 记录
原文地址:https://www.cnblogs.com/zxcv123/p/11907839.html