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

MySqlͨÓô洢·ÖÒ³

DELIMITER $$
DROP PROCEDURE IF EXISTS `hotel`.`prc_page_hotel_result`$$
CREATE DEFINER=`root`@`localhost` PROCEDURE  `hotel`.`prc_page_hotel_result`(
in currpage      int,
in columns       varchar(500),
in tablename     varchar(500),
in sCondition    varchar(500),
in order_field   varchar(100),
in asc_field     int,
in Primary_field varchar(100),
in pagesize      int
)
begin
    declare sTemp  varchar(1000);
    declare sSql   varchar(4000);
    declare sOrder varchar(1000);
   
    if asc_field = 1 then
        set sOrder = concat(' order by ', order_field, ' desc ');
        set sTemp  = '<(select min';
    else
        set sOrder = concat(' order by ', order_field, ' asc ');
        set sTemp  = '>(select max';
    end if;
   
    if currpage = 1 then
        if sCondition <> '' then
            set sSql = concat('select ', columns, ' from ', tablename, ' where ');
            set sSql = concat(sSql, sCondition, sOrder, ' limit ?');
        else
            set sSql = concat('select ', columns, ' from ', tablename, sOrder, ' limit ?');
        end if;
    else
        if sCondition <> '' then
          &nb


Ïà¹ØÎĵµ£º

Java ¶ÁÈ¡ MySQL ÖÐÎÄ ÂÒÂë

Java ¶ÁÈ¡ MySQL ÖÐÎÄ ÂÒÂë
³¡¾°:Java,eclipse£¬¶ÁÈ¡MySQLÊý¾Ý¿â£¬MySQL±àÂëΪutf-8
ÎÊÌ⣺¶Á³öÀ´µÄÖÐÎÄÔÚeclipseµÄÊä³ö´°¿ÚÖÐÏÔʾΪÂÒÂë
´íÎóµÄд·¨
1
   System.out.print(new String( rs.getString("bib_author").getBytes("utf-8"),"GBK" )); 

   System.out.print( ......

ÔÚSQLÖÐʹÓÃnow()µ¼ÖµÄÐÔÄÜϽµ(MySQL)

×öÊý¾Ý¿âµ÷ÓÅ£¬Ò»¸ö¼òµ¥µÄtip¾ÍʹÐÔÄÜÌáÉýÒ»´ó¿éʱ£¬±»°ïÖúµÄÈË×ÔÈ»ÊǸßÐ˶øÇҸм¤£¬ÎÒÒ²ÊÇÂúÐÄ»¶Ï²¡£ÓÃËùѧ°ïÖúÁËËûÈË£¬Ò²ËµÃ÷»¹ÊÇÓÐÒ»¼¼Ö®³¤µÄ£¬ÓÐÒ»ÃÅÄܹ»Ñø»î×Ô¼ºµÄÊÖÒÕ¡£Ò²ËãÊÇÊÖÒÕÈË°¡¡£
ͬÊÂÈÃÎÒ°ïÖúÓÅ»¯£¬ÔÚslow query logÀï·¢ÏÖÓÐÁ½¸öSQLÖ´ÐеĴÎÊý×î¶à£¬²¢ÇÒÿ´Î¶¼ÔÚÁ½ÃëÒÔÉÏ¡£ÓÃexplain¿´ÁË£¬Ò²Î´·¢ÏÖË÷ÒýʹÓ÷ ......

MySQLÔÓ

MySQLµÄtimestampÀàÐÍ×Ô¶¯¸üÐÂÎÊÌâ
 ½ñÌ콨ÁËÒ»¸ö±í£¬ÀïÃæÓÐÒ»¸öÁÐÊÇtimestampÀàÐÍ£¬ÎÒ±¾ÒâÊÇÔÚÊý¾Ý¸üÐÂʱ£¬Õâ¸ö×ֶεÄʱ¼äÄÜ×Ô¶¯¸üС£ÆñÖª¶ÔÕâ¸öÀàÐ͵ÄÖµ»¹²»ÉõÁ˽⣬µ¼Ö³ö´í¡£·¢ÏÖÕâ¸ö×Ö¶ÎÖ»ÊÇÔÚÕâÐÐÊý¾Ý½¨Á¢µÄʱºòÓÐÖµ£¬ÔÚ¸üеÄÈ´Îޱ仯¡£
    ²éÕÒ×ÊÁÏ£¬·¢ÏÖÊÇÎÒ½¨±íµÄÓï¾äÓÐÎÊÌ⣺
ÒÔÏÂÊÇ´ú ......

ͨ¹ý·ÖÇø£¨Partition£©ÌáÉýMySQLÐÔÄÜ

 
ͨ¹ý·ÖÇø£¨Partition£©ÌáÉýMySQLÐÔÄÜ
×÷Õߣºfoxcai À´Ô´:foxcai µÄ Blog (2006-05-08 14:30:34)
ͨ¹ý·ÖÇø£¨Partition£©ÌáÉýMySQLÐÔÄÜ
               ——MySQL5.1ÐÂÌØÐÔ·­ÒëϵÁÐ
¼¸ÄêÇ°£¬°³Ð´¹ýһƪÌâΪ“The Founda ......

MySQL ×Ö·û´®º¯Êý£º×Ö·û´®½ØÈ¡

 MySQL ×Ö·û´®½ØÈ¡º¯Êý£ºleft(), right(), substring(), substring_index()¡£»¹ÓÐ mid(), substr()¡£ÆäÖУ¬mid(), substr() µÈ¼ÛÓÚ substring() º¯Êý£¬substring() µÄ¹¦Äܷdz£Ç¿´óºÍÁé»î¡£
1. ×Ö·û´®½ØÈ¡£ºleft(str, length)
mysql> select left('sqlstudy.com', 3);
+-------------------------+
| left('sq ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ