group by 后面不应该有b.timestr啊......写成
select a.user_name,b.timestr,max(b.kills) from user1 a join user_kills b on a.id = b.user_id group by a.user_name;
是完全可以查询出结果的。
select a.user_name,b.timestr,max(b.kills) from user1 a join user_kills b on a.id = b.user_id group by a.user_name;
是完全可以查询出结果的。
2015-07-18
直接写
update user1 a inner join user2 b on a.user_name = b.user_name set a.over='齐天大圣';
不是更好么,没必要这么麻烦吧。
update user1 a inner join user2 b on a.user_name = b.user_name set a.over='齐天大圣';
不是更好么,没必要这么麻烦吧。
2015-07-17
老师的分组查询中,分组错误导致没有得到结果。
select a.user_name,b.timestr,max(b.kills)
from user1 a join user_kills b on a.id = b.user_id
group by a.user_name。该语句建议最后见“order by null”
算上老师最后给出的两次join的方式,可以explain 看一下3中方式哪个最优。
select a.user_name,b.timestr,max(b.kills)
from user1 a join user_kills b on a.id = b.user_id
group by a.user_name。该语句建议最后见“order by null”
算上老师最后给出的两次join的方式,可以explain 看一下3中方式哪个最优。
2015-07-09
大哥,你分组查询查询错误,所以没有出来正确的结果
select a.user_name,b.timestr,max(b.kills)
from user1 a join user_kills b on a.id = b.user_id
group by a.user_name
select a.user_name,b.timestr,max(b.kills)
from user1 a join user_kills b on a.id = b.user_id
group by a.user_name
2015-06-30