Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

Ò»¸ö¸´ÔÓµÄmysql²éѯÓï¾ä(case,when,then,left join )

select `a`.`id` AS `id`,`a`.`UserName` AS `UserName`,
(case when (`a`.`sRegDate` = _utf8'1990-01-01 00:00:00.0') then _utf8'' else cast(date_format(`a`.`sRegDate`,_utf8'%Y-%m-%d %H:%i:%S') as char charset utf8) end) AS `sRegDate`,(case when (`a`.`feeendtime` = _utf8'1990-01-01 00:00:00.0') then _utf8'' else cast(date_format(`a`.`feeendtime`,_utf8'%Y-%m-%d %H:%i:%S') as char charset utf8) end) AS `feeendtime`,
(case when (`a`.`iStatus` = _utf8'0') then _utf8'Õý³£' when (`a`.`iStatus` = _utf8'1') then _utf8'Ëø¶¨' when (`a`.`iStatus` = _utf8'2') then _utf8'Ç··Ñ' when (`a`.`iStatus` = _utf8'') then _utf8'ÉêÇëÍ£»ú' else _utf8'' end) AS `iStatus`,
(case when (`a`.`PayType` = _utf8'0') then _utf8'Ãâ·Ñ' when (`a`.`PayType` = _utf8'2') then _utf8'Ð¡ÇøÍøÓû§' when (`a`.`PayType` = _utf8'10') then _utf8'ÍⲿÓû§' else _utf8'' end) AS `PayType`,
`c`.`UserType` AS `sDh1`,`b`.`FeeName` AS `iFeeType`,
(case when (`a`.`PauseStartTime` = _utf8'1990-01-01 00:00:00.0') then _utf8'' else cast(date_format(`a`.`PauseStartTime`,_utf8'%Y-%m-%d %H:%i:%S') as char charset utf8) end) AS `PauseStartTime`,
(case when (`a`.`PauseStopTime` = _utf8'1990-01-01 00:00:00.0') then _utf8'' else cast(date_format(`a`.`PauseStopTime`,_utf8'%Y-%m-%d %H:%i:%S') as char charset utf8) end) AS `PauseStopTime`,
(case when (`a`.`AcctStartTime` = _utf8'1990-01-01 00:00:00.0') then _utf8'' else cast(date_format(`a`.`AcctStartTime`,_utf8'%Y-%m-%d %H:%i:%S') as char charset utf8) end) AS `AcctStartTime`,
(case when (`a`.`AcctStopTime` = _utf8'1990-01-01 00:00:00.0') then _utf8'' else cast(date_format(`a`.`AcctStopTime`,_utf8'%Y-%m-%d %H:%i:%S') as char charset utf8) end) AS `AcctStopTime`,
`a`.`speed` AS `speed`,
(case when (`a`.`idtype` = _utf8'7') then _utf8'Éí·ÝÖ¤' when (`a`.`idtype` = _utf8'1') then _utf8'½ÌÖ°¹¤' when (`a`.`idtype` = _utf8'2') then _utf8'±¾¿ÆÉú' when (`a`.`idtype` = _utf8'3') then _utf8'Ñо¿Éú' when (`a`.`idtype` = _utf8'4') then _utf8'ÀëÍËÉú' when (`a`.`idtype` = _utf8'5') then _utf8'


Ïà¹ØÎĵµ£º

¸øÄãµÄMySqlÊÜÔ¶³Ì·ÃÎÊȨÏÞ

¸ømysql¿ªÒ»¸ö¿ÉÒÔÔ¶³Ì·ÃÎʵÄÓû§ÃüÁîÈçÏÂ:
GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'%' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;
"*.*" ±íʾÊý¾Ý¿âÖÐËùÓеıí,Ò²¿ÉÒÔ»»³ÉÖ¸¶¨µÄ±íÈçtest.*
"myuser" ±íʾµÄÊÇ·ÃÎʵÄÓû§Ãû;
"%" ±íʾËùÓеÄÖ÷»ú¼´ÈκεÄÖ÷»ú¶¼¿ÉÒÔͨ¹ýÕâ¸öÓû§Ãû·ÃÎÊÎÒµÄÊý¾Ý¿â,Ò²¿ÉÒԸóÉÌØ¶¨µ ......

java¶ÁÈ¡mysqlÊý¾Ý¿âlatin1±ÜÃâÂÒÂë·½·¨

дÈëʱ£¬ÏÈ×öencode£º
public static String encode(String src) {
String result = null;
try {
result = new String(src.getBytes("gbk"), "ISO-8859-1");
} catch (UnsupportedEncodingException uee) {
System.err.println(uee);
}
return result;
}
¶Á³öʱ£¬ÔÙ×ödecode£º
public static String deco ......

MySQLÊý¾Ý¿â±¸·ÝºÍ»¹Ô­µÄ³£ÓÃÃüÁת¡¿


MySQLÊý¾Ý¿â±¸·ÝºÍ»¹Ô­µÄ³£ÓÃÃüÁî
Ô­Îļûhttp://www.21andy.com/blog/20071102/655.html
ʱ¼ä£º2007-11-02 23:29:09   Àà±ð£º¼¼Êõ   ·ÃÎÊ£º3,731 views   RSS 2.0   ÆÀÂÛ  
±¸·ÝMySQLÊý¾Ý¿âµÄÃüÁî
mysqldump -hhostname -uusername -ppassword database ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ