MySQL COUNT SUM
select
count(*) as mcount ,
left(create_time,10) as ptime ,
count(if(receive_msg is null,id,null)) as nullcount ,
count(if(receive_msg = '1',receive_msg,null)) as apfcount ,
count(if(receive_msg = '2',receive_msg,null)) as dttcount ,
count(if(receive_msg = '3',receive_msg,null)) as dicount
from
t_votes
where
left(create_time,7)>='$pearly'
and
left(create_time,7)<='$plate'
group by
ptime ;
COUNT(*)´øÉÏֵΪNULLµÄ
COUNT(table_name)²»´øÖµÎªNULLµÄ
¼ÆÊý²»ÇóºÍ,¿ÉÓÃÆäËû×Ö¶ÎÌæ´ú
select
count(*) as mcount ,
left(create_time,10) as ptime ,
SUM(if(receive_msg is null,id,0)) as nullcount ,
SUM(if(receive_msg = '1',receive_msg,0)) as apfcount ,
SUM(if(receive_msg = '2',receive_msg,0)) as dttcount ,
SUM(if(receive_msg = '3',receive_msg,0)) as dicount
from
t_votes
where
left(create_time,7)>='$pearly'
and
left(create_time,7)<='$plate'
group by
ptime ;
SUMÇóºÍ,×îºóÒ»¸ö²ÎÊý¸ÄΪ0.¾ßÌåÔÒò²»Ã÷
Ïà¹ØÎĵµ£º
1.´Óhttp://prdownloads.sourceforge.net/mysqldrivercs/MySQLDriverCS-n-EasyQueryTools-3.0.18.exe?downloadÉÏÏÂÔØMySQLDriverCS.
2.°ÑMySQLDriverCS.dll.Ìí¼Óµ½.netµÄ×é¼þ
3.ʹÓ÷½·¨
ÏÂÃæÊÇ´´½¨Ò»¸öÊý¾Ý¿âÁ´½Ó:
ÏÂÃæÊÇ´´½¨Ò»¸öÊý¾Ý¿âÁ´½Ó:
using MySQLDriverCS;
MySQLConnection conn ......
mysql> use information_schema
Database changed
mysql> select concat(round(sum(index_LENGTH)/(1024*1024),2),'MB') as 'Data Size' from tables where table_schema='bbs';
+-----------+
| Data Size |
+-----------+
| 0.00MB |
+-----------+
1 row in set (0.01 sec)
½âÊÍ£º
......
MySQLµÄÿ¸öÊý¾Ý¿âĿ¼ÖÐÓÐÒ»¸öÎļþdb.opt,¸ÃÎļþÖ÷Òª ÓÃÀ´´æ´¢µ±Ç°Êý¾Ý¿âµÄĬÈÏ×Ö·û¼¯ºÍ×Ö·ûУÑ鹿Ôò¡£
eg.default-character-set=latin1
default-collation=latin1_swedish_ci
¸ÃÎļþÖд洢µÄÊÇ´´½¨Êý¾Ý¿âʱĬÈϵÄ×Ö·û¼¯ºÍ×Ö·û¼¯Ð£Ñ鹿Ôò£¬Ôò¸ÃÊý¾Ý¿âÔÚÒÔºó´´½¨±íʱÈç¹ûûÓÐÖ¸¶¨×Ö·û¼¯ºÍУÑ鹿Ôò£¬Ôò¸Ã±íµÄÕâÁ½¸ö ......
1.JBPM4.3ÏÂÔØ(http://sourceforge.net/projects/jbpm)
2.ant°²×°:jBPMÏÂÔØ°üinstallĿ¼ÖÐÓÐÒ»¸öantµÄbuild.xmlÎļþ,ʹÓÃant -pÄã¿ÉÒÔ¿´µ½ËùÓеݲװ
demo.setup.jboss£º°²×°jboss£¬°Ñjbpm°²×°µ½jbossÖУ¬ Æô¶¯jboss£¬´´½¨jbpmÊý¾Ý¿â±í½á¹¹£¬²¿ÊðʵÀý£¬¼ÓÔØÊµÀýÉí·ÝÈÏÖ¤ÐÅÏ¢£¬ °²×°²¢Æô¶¯eclipse
&n ......
Ò»¡¢Á¬½ÓMYSQL¡£
¸ñʽ£º mysql -hÖ÷»úµØÖ· -uÓû§Ãû £pÓû§ÃÜÂë
1¡¢Àý1£ºÁ¬½Óµ½±¾»úÉϵÄMYSQL¡£
Ê×ÏÈÔÚ´ò¿ªDOS´°¿Ú£¬È»ºó½øÈëĿ¼ mysqlbin£¬ÔÙ¼üÈëÃüÁîmysql -uroot -p£¬»Ø³µºóÌáʾÄãÊäÃÜÂ룬Èç¹û¸Õ°²×°ºÃMYSQL£¬³¬¼¶Óû§rootÊÇûÓÐÃÜÂëµÄ£¬¹ÊÖ±½Ó»Ø³µ¼´¿É½øÈëµ½MYSQLÖÐÁË£¬MYSQLµÄÌáʾ·ûÊÇ£ºmysql>
2¡¢Àý2£ºÁ ......