易截截图软件、单文件、免安装、纯绿色、仅160KB

mysql 一道小题

 表名为table的表内容如下
Year month value
2009  1    1.1
2009  2    1.2
2009  3    1.3
2009  4    1.4
2010  1    2.1
2010  2    2.2
2010  3    2.3
2010  4    2.4
要求查询结果为
year  m1  m2  m3  m4
2009  1.1  1.2  1.3  1.4
2010  2.1  2.2  2.3  2.4
mysql> select year,sum(case when month=1 then value end) as 'm1',sum(case when m
onth=2 then value end) as 'm2',sum(case when month=3 then value end)as 'm3' from
 table2 group by year;


相关文档:

MySQL与C/C++接口应用学习

 ---- 在数据库的应用开发中,常常会遇到性能和代价的之间矛盾。以作者在开发股市行
情查询和交易系统中遇到的问题为例,要在实时记录1000多只股票每分钟更新一次的行
情数据的同时,响应大量并发用户的数据查询请求。考虑到性价比和易维护性,系统又
要求在基于PC服务器,Windows NT平台的软硬件环境下实现。开 ......

MySQL: Connect MySQL GUI tools to WAMP 2.0

Connect MySQL GUI tools to WAMP 2.0 Posted by: Vladislav Sadykov () Date: January 24, 2009 09:31AM Hay, I have a problem with MySQL database. I have installed WAMP 2.0 server on my Windows machine and now I would like to connect it with MySQL GUI tools 5. The problem is that at the startup of ......

Windows下安装最新的Apache+PHP+MySQL指南

 注意:之前我在网上找了好多的资料 NND都不能正常配置成功 搞得我是非常地郁闷!
找到这篇文章之后我终于配置成功了!哇好爽呀!只要按照 上面的步骤就一定能够成功的!
此文章的安装方法适用于Windows XP下的Apache+PHP+MySQL安装,同时也适用于Windows 2003系统下的安装和配置。
1. 安装环境
操作系统是 Window ......

mysql 查看索引使用情况

 这是以读为主的线上库
root@read 02:28:07>show status like ‘Handler_read%’; 
+———————–+——-+ 
| Variable_name         | Value | 
+————&m ......

mysql替换数据库中的部分内容

  例子:将cdb_pms表subject字段中的Welcom to替换成 欢迎光临
UPDATE `cdb_pms`
SET `subject` = REPLACE(`subject`, ‘Welcome to’, ‘欢迎光临’)
WHERE INSTR(`subject`,’Welcome to’) < 0 替换cdb_posts表的message字段,将“viewthread.php?tid=3989”替换成“viewthread.php?tid=16546” U ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号