如何计算行 [英] How To Calculate The Rows

查看:89
本文介绍了如何计算行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在PHP代码中需要帮助它将计算总数!例如2 + 2 = 4





在Mysql数据库中

 <   pre     lang   =  SQL >  ----------------------------------------- 
id |名字|评级|
1 | php | 4 |
2 | css | 7 |
3 | php | 6 |
4 | css | 5 |
5 | HTML | 6 |
6 | php | 9 |
-----------------------------------------







我需要外出点赞



PHP =有19个评分

css =有12个评分

Html =有6个评分



i需要一个pp代码它显示像这样plz帮助我

解决方案

即使它是非常基本的查询,你可以在谷歌搜索,但解决你的问题下面是你的查询需要。



 选择名称,总和(评级)来自 table_name  group   by  name 


好的,非常感谢你!!! ........

I Need A Help In PHP Code Where It Will Calculate the total ! For Example 2+2 = 4
!

In Mysql Database

<pre lang="SQL">-----------------------------------------
id   |    name     |      ratings    |
1    |    php      |        4       |
2    |    css      |        7       |
3    |    php      |        6       |
4    |    css      |        5       |
5    |    html     |        6       |
6    |    php      |        9       |
-----------------------------------------




I Need The Out Put like

PHP = Has 19 Ratings
css = Has 12 Ratings
Html = has 6 ratings

i need a pp code where it shows like this plz help me

解决方案

Even though it is very basic query that you can search out on google, but to solve your problem below is the query that you need.

select name,sum(ratings) from table_name group by name


Okay Thank You So Much !!! ........


这篇关于如何计算行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆