mysql ·Ö×é»ã×Ü
1.´´½¨±í£º
create table groupTable(dept varchar(6),phone varchar(20),amount int);
2.²åÈë²âÊÔÊý¾Ý£º
insert groupTable
select 'ÓªÒµ²¿',8001,20 union all
select 'ÓªÒµ²¿',8002,30 union all
select '²ÆÎñ²¿',6001,10 union all
select '²ÆÎñ²¿',6003,100;
3.mysql Óï¾ä£º
select ifnull(dept,'×ܼÆ') as '²¿ÃÅ',ifnull(phone,'С¼Æ') as 'µç»°',sum(money) as '½ð¶î' from groupTable group by
dept,phone with rollup;
4.½á¹ûÏÔʾ£º
+--------+------+------+
| ²¿ÃÅ | µç»° | ½ð¶î |
+--------+------+------+
| ²ÆÎñ²¿ | 6001 | 10 |
| ²ÆÎñ²¿ | 6003 | 100 |
| ²ÆÎñ²¿ | С¼Æ | 110 |
| ÓªÒµ²¿ | 8001 | 20 |
| ÓªÒµ²¿ | 8002 | 30 |
| ÓªÒµ²¿ | С¼Æ | 50 |
| ×Ü¼Æ | С¼Æ | 160 |
+--------+------+------+
Ïà¹ØÎĵµ£º
½ñÌì×°ÁËһ̨Linuxϵͳ£¬ÒÔÇ°¶¼ÊÇRedHat£¬ºóÀ´Ìý˵ÓÐFedoraÁË£¬Ò»Ö±Ã»Óùý¡£ÕýºÃÏîÄ¿Àï»·¾³ÒªÓþÍÏëŪһ¸öÀ´ÍæÍ棬½á¹ûÏÖÔÚÈ˼Ò×îеÄÊÇCentOS£¬¾ÍÒ»ÕÅCD£¬ÆäËûµÄ¸ù¾ÝÐèÒª×Ô¼ºÉÏÍøDown£¬£¨ÎÒ²»Ï²»¶ÕâÑù×Ó¾Í×Ô¼ºÏÂÔØDVD°æ£©¡£°²×°ÍêÖ®ºóûÓÐͼÐνçÃ棬¶øÇÒûÓÐÌáʾÊäÈërootÃÜÂ룬»¹µÃµ½µ¥Óû§Ä£Ê½ÏÂÐ޸ġ£ºóÀ´ÏÂÔØÁËÒ»¸öͼÐÎ ......
Ê×ÏÈ¿´¿´ jspÎļþ java³ÌÐòÀïÓÐûÓÐrequest.setCharacterEncoding("UTF-8");
×Ö·û±àÂëÎÊÌ⣬Êý¾Ý²åÈë¿âÖÐʱ£¬java±àÂëºÍÊý¾Ý¿â±àÂë²»Ò»Ö£¬µ¼Ö²åÈëÊý¾Ý¿âΪÂÒÂ룬¿´µ½Îª£¿£¿£¿£¿µÄÐÎʽ
½«ÄãµÄjspÒ³Ãæ±àÂë¸ÄΪGBK£¬Êý¾Ý¿â¶ÔÓ¦±íµÄ±àÂëÒ²¸ÄΪGBK
±àÂëÒ»Ö£¬¾Í²»»á³öÏÖÂÒÂëÎÊÌâÁ ......
MYSQL°²×°
//½âѹ±àÒë°²×°
# tar xzvf mysql-5.0.27.tar.gz
# cd mysql-5.0.27
# ./configure -prefix=/home/redadmin/mysql
# make
# make install
# cd /home/redadmin/mysql/
# cp share/mysql/my-medium.cnf ./
# mv my-medium.cnf my.cnf
// my.confÎļþÐÞ¸Ä
# vi my.cnf
ÐÞ¸ÄÇ°£º
port &nb ......
½ñÌ죬ҪÓÃexplain²é¿´mysqlµÄÖ´Ðй滮£¬µ«ÊǺÍPostgreSQL²»Í¬µÄÊÇ£¬Ö±½ÓÔÚmysqlÀïÃæÖ´ÐеĽá¹û¿É¶ÁÐÔ²»ÊǺܺã¬ÉÏÍøËÑÁËһȦ£¬·¢ÏÖÁËÒ»¸ö¹¤¾ßmaatkit£¬¿ÉÒÔ½²explainµÄ½á¹ûת»¯ÎªÊ÷×´½á¹¹²é¿´£¬ºÇºÇ£¬·½±ãÁ˺ܶà
°²×°°ì·¨£º
1. sudo yum install mysql
2. sudo yum install mysql-server
3. wget http://maatkit.googl ......
from:http://www.ccvita.com/100.html
mysql 5.0´æ´¢¹ý³Ìѧϰ×ܽá
Ò».´´½¨´æ´¢¹ý³Ì
1.»ù±¾Óï·¨£º
create procedure sp_name()
begin
………
end
2.²ÎÊý´«µÝ
¶þ.µ÷Óô洢¹ý³Ì
1.»ù±¾Óï·¨£ºcall sp_name()
×¢Ò⣺´æ´¢¹ý³ÌÃû³ÆºóÃæ±ØÐë¼ÓÀ¨ºÅ£¬ÄÄŸô洢¹ý³ÌûÓвÎÊý´«µÝ
Èý.ɾ³ý´æ´¢¹ý³Ì
1 ......