select Aname,Asum,Bzong from (select name, sum(xiaoshou) as sum from shujv group by name) A
inner join (select name,zong from shujv order by month desc Limit 1) B
on Aname=Bname
你试一下这个怎么样:
MySQL字符串大小写转换需要用到MySQL字符串大小写转换函数,MySQL 字符串大小写转化函数有两对: lower(), uppper() 和 lcase(), ucase():
mysql> select lower('DDD');
+--------------+
| lower('DDD') |
+--------------+
| ddd |
+--------------+
mysql> select upper('ddd');
+--------------+
|upper('ddd') |
+--------------+
| DDD |
+--------------+
mysql> select lcase('DDD');
+--------------+
| lcase('DDD') |
+--------------+
| ddd |
+--------------+
mysql> select ucase('ddd');
+--------------+
| ucase('ddd') |
+--------------+
| DDD |
+--------------+
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)