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

OracleDB,MySQL×Ö·û´®²Ù×÷º¯ÊýINSTR£¬SUBSTRING_INDEX

ÌâÄ¿£º¸ø¶¨Ò»¸ö·Ö¸î·û£¬ÔõÑùµÃµ½¸ø¶¨×Ö·û´®×îºóÒ»¸ö·Ö¸î·ûºóµÄ×Ö·û´®¡£ È磺‘fsb-ibees-zxj-fsbk’ ÔõÑùµÃµ½fsbk, ÒªÇó£ºjavaʵÏÖ£¬sqlʵÏÖ£¿sql¿ÉÒÔÊÇoracle£¬mysqlµÈʵÏÖ¡£
 1.OracleʵÏÖ
SET SERVEROUTPUT ON;
DECLARE
str VARCHAR2(266):='123-890-ibees-zxj';--±»½âÎöµÄ×Ö·û´®
splitStr VARCHAR2(64):= '-';--·Ö¸î×Ö·û´®
astr VARCHAR2(266); --×îºóÒ»¸ö·Ö¸î·ûºóµÄ×Ö·û´®
BEGIN
SELECT SUBSTR(str,INSTR(str,splitStr,-1,1)+1,LENGTH(str)-INSTR(str,splitStr,-1,1)+1)
INTO astr
from DUAL;

DBMS_OUTPUT.PUT_LINE(astr);
END;
/
Ö÷ÒªÊÇINSTRµÄÓ÷¨¡£¼òµ¥µÄÓ÷¨Îª:
SELECT SUBSTR('123-890-ibees-zxj',INSTR('123-890-ibees-zxj','-',-3,1)+1,LENGTH('123-890-ibees-zxj')-INSTR('123-890-ibees-zxj','-',-3,1)+1) from DUAL;
 2. MySQLʵÏÖ
SELECT SUBSTRING_INDEX('123-890-ibees-zxj','-',-1) ;
Õâ¸ö·½·¨Ö±½Ó»ñµÃ×îºóÒ»¸ö·Ö¸î·ûºóµÄ×Ö·û´®.
3.JavaʵÏÖ
String s = "jdkfdsf-sdekjre-kdkf";
String[] sarray = s.split('-');
String last = sarray[sarray.length-1];


Ïà¹ØÎĵµ£º

ubuntu9.04Öа²×°ÅäÖÃphp5 + MySql + Apache

   - -!   Õæ²»ÈÝÒ×°¡£¬ÅªÁËÒ»Ì죬ÖÕÓڸ㶨ÁË£¡
  ÔÚubuntu9.04Ï°²×°£¬Ê×ÏÈҪ׼±¸µÄ¶«Î÷ºÜ¶à£¬´ó²¿·ÖÊÇÓÃÀ´Ö§³ÖphpµÄ¿â£¬·Ï»°²»¶à˵£¬Ð´Õâ¸öÒ²ÊÇΪÁ˱ãÓÚÎÒÒÔºó²é¿´Ó㬼ÇÒä²»ÐУ¬¿È¡£¡£ÓÐÐèÒªµÄÅóÓÑÒ²¿ÉÒÔÀ´È¥Óá£
  ÔÚubuntuÉÏ°²×°£¬ÓÐÒ»¸öºÃ´¦¾ÍÊÇÓÐÐÂÁ¢µÃÕâ¸öÈí¼þ£¬Ê×ÏÈÏÈ°²×°mysql£¬ ......

Jsp Á¬½Ó mySQL¡¢Oracle Êý¾Ý¿â±¸Íü

Jsp Á¬½Ó mySQL¡¢Oracle Êý¾Ý¿â±¸Íü
2009-12-15 16:47
Jsp »·¾³Ä¿Ç°×îÁ÷ÐеÄÊÇ Tomcat5.0¡£Tomcat5.0 ×Ô¼º°üº¬Ò»¸ö Web ·þÎñÆ÷£¬Èç¹ûÊDzâÊÔ£¬¾Íû±ØÒª°Ñ Tomcat Óë IIS »ò Apache ¼¯³ÉÆðÀ´¡£ÔÚ Tomcat ×Ô´øµÄ Web ·þÎñÆ÷Ï¿ÉÒÔ½øÐÐ Jsp ²âÊÔ¡£
    °²×° Tomcat5.0 Ç°ÐèÒª°²×° JDK(Èç¹ûÊÇ Windows server ......

Mysql ´¥·¢Æ÷ʵÀý

MySQL ´¥·¢Æ÷¼òµ¥ÊµÀý
1¡¢Óï·¨£º
CREATE TRIGGER <´¥·¢Æ÷Ãû³Æ>  --´¥·¢Æ÷±ØÐëÓÐÃû×Ö£¬×î¶à64¸ö×Ö·û£¬¿ÉÄܺóÃæ»á¸½Óзָô·û.ËüºÍMySQLÖÐÆäËû¶ÔÏóµÄÃüÃû·½Ê½»ù±¾ÏàÏó.
{ BEFORE | AFTER }  --´¥·¢Æ÷ÓÐÖ´ÐеÄʱ¼äÉèÖ㺿ÉÒÔÉèÖÃΪʼþ·¢ÉúÇ°»òºó¡£
{ INSERT | UPDATE | DELETE }  --ͬÑùÒ²ÄÜÉ趨´¥· ......

MYSQLÃüÁî´óÈ«

MYSQLÃüÁî´óÈ«
Ò»¡¢Á¬½ÓMYSQL¡£
¸ñʽ£º mysql -hÖ÷»úµØÖ· -uÓû§Ãû £­pÓû§ÃÜÂë
1¡¢Á¬½Óµ½±¾»úÉϵÄMYSQL¡£Ê×ÏÈ´ò¿ªDOS´°¿Ú£¬È»ºó½øÈëĿ¼mysql\bin£¬ÔÙ¼üÈëÃüÁîmysql -u root -p£¬»Ø³µºóÌáʾÄãÊäÃÜÂë.×¢ÒâÓû§ÃûÇ°¿ÉÒÔÓпոñÒ²¿ÉÒÔûÓпոñ£¬µ«ÊÇÃÜÂëÇ°±ØÐëûÓпոñ£¬·ñÔòÈÃÄãÖØÐÂÊäÈëÃÜÂë. Èç¹û¸Õ°²×°ºÃMYSQL£¬³¬¼¶Óû ......

MySQLѧϰ±Ê¼Ç£ºInnoDBºÍMyISAMµÄ²î±ð


InnoDB
ºÍMyISAM
ÊÇÔÚʹÓÃMySQL
×î³£ÓõÄÁ½¸ö±íÀàÐÍ£¬¸÷ÓÐÓÅȱµã£¬ÊÓ¾ßÌåÓ¦Óöø¶¨¡£»ù±¾µÄ²î±ðΪ£ºMyISAM
ÀàÐͲ»Ö§³ÖÊÂÎñ´¦ÀíµÈ¸ß¼¶´¦Àí£¬¶øInnoDB
ÀàÐÍÖ§³Ö¡£MyISAM
ÀàÐ͵ıíÇ¿µ÷µÄÊÇÐÔÄÜ£¬ÆäÖ´ÐÐÊý¶È±ÈInnoDB
ÀàÐ͸ü¿ì£¬µ«ÊDz»ÌṩÊÂÎñÖ§³Ö£¬¶øInnoDB
ÌṩÊÂÎñÖ§³ÖÒѾ­Íⲿ¼üµÈ¸ß¼¶Êý¾Ý¿â¹¦ÄÜ¡£
MyIASMÊÇIASM± ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ