groupby 和left join
Posted huiandong
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了groupby 和left join相关的知识,希望对你有一定的参考价值。
select * from so_android_hour sah group by open_third_party left join so_plan sp on sah.open_third_party=sp.sell_no limit 10;
词条语句报错:You have an error in your SQL syntax; check the manual that corresponds to your mysql server version for the right syntax to use near ‘left join so_plan sp on sah.open_third_party=sp.sell_no limit 10‘ at line 1
select * from so_android_hour sah left join so_plan sp on sah.open_third_party=sp.sell_no limit 10;没有 group by open_third_party正常执行。
结论groupby和join不能用在一条语句
以上是关于groupby 和left join的主要内容,如果未能解决你的问题,请参考以下文章