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

¾¡Á¿±ÜÃâÔÚSQLÓï¾äÖÐʹÓÃLIKE

----start
    Ç°Ã棬ÎÒÃǽéÉÜÁË ¾¡Á¿±ÜÃâÔÚSQLÓï¾äµÄWHERE×Ó¾äÖÐʹÓú¯Êý£¬ÒòΪÕâÑù×ö»áʹ¸Ã×Ö¶ÎÉϵÄË÷ÒýʧЧ£¬Ó°ÏìSQLÓï¾äµÄÐÔÄÜ¡£»ùÓÚͬÑùµÄµÀÀí£¬ÎÒÃÇÒ²Ó¦¸Ã±ÜÃâʹÓÃLIKE¡£¿¼ÂÇÏÂÃæµÄÇé¿ö£º
CREATE TABLE USER
(
NAME VARCHAR(20) NOT NULL,---ÐÕÃû
MYNUMBER VARCHAR(18)---Éí·ÝÖ¤ºÅÂë
); 
ÏÖÔÚÒªÇóÄã°ÑÉí·ÝÖ¤ºÅÂ뿪ͷÊÇ2102£¨´óÁ¬ÈË£©²é³öÀ´£¬Ôõô°ì£¿ÎÒÃǺÜ×ÔÈ»µÄ»áÕâôд£º
SELECT * from USER WHERE MYNUMBER LIKE '2102%'; 
ÉÏÊöÓï¾äÍêÈ«ÕýÈ·£¬Ö»¿ÉϧÐÔÄܲ»ºÃ£¬ÄÇôµ½µ×ÈçºÎ´¦ÀíÄØ£¿´ð°¸Êǽ«Ëüת»¯Îª·¶Î§É¨Ã裬ÈçÏ£º
SELECT * from USER WHERE MYNUMBER>='210200000000000000' AND MYNUMBER<'210300000000000000'; 
---¸ü¶à²Î¼û£ºDB2 SQL ¾«Òª
----ÉùÃ÷£º×ªÔØÇë×¢Ã÷³ö´¦¡£
----last update at 2009.9.24
----write by wave at 2009.9.24
----end


Ïà¹ØÎĵµ£º

¿ª·¢¸¨Öú¹¤¾ß£ºSQLÎĸñʽ»¯¹¤¾ßSQLinFormpro_Desktop

    ÔÚÓйØÊý¾Ý¿âµÄÏîÄ¿¿ª·¢ÖУ¬±àÂ룬bugÐ޸ĵȵȣ¬¶¼ÐèÒª²é¿´²Ù×÷Ïà¹ØµÄSQLÎÄ£¬Èç¹ûSQLÎıȽϸ´ÔӵĻ°£¬ÎÒÃÇ×Ô¼ºÅÅ°æ·Ç³£Âé·³£¬Í¬Ê±Ò²ºÜ»¨·Ñʱ¼ä¡£¿ÉÄÜÓеĹ«Ë¾×Ô¼º¿ª·¢Á˸ñʽ»¯¹¤¾ß»òÕß¹ºÂòÁ˸ñʽ»¯¹¤¾ßÈí¼þ¡£ÓÐÁ˸ñʽ¹¤¾ßÎÒÃǾͽÚÊ¡ÁËÅÅ°æʱ¼ä¡£
    ½éÉÜÒ»ÏÂSQLinFormpro_Desktop£¨htt ......

oracle sql ʱ¼ä¼ä¸ô¼ÆËã

¼ÆËã¼ä¸ôʱ¼ä£º
select f_date,f_cstime,f_cetime, (((SYSDATE- TO_DATE(f_date||f_cstime,'YYYYMMDDHH24MISS')) * 86400000)-((SYSDATE- TO_DATE(f_date||f_cetime,'YYYYMMDDHH24MISS')) * 86400000))/1000  CURRENT_MILLI from ycsq_t_hauthlog where f_cstime<>'999999'
½«×Ö·û´®×ª»»³ÉÈÕÆÚÀà:SYSDATE- TO_ ......

£¨×îгɹ¦£©Ãâ°²×°OracleÔËÐÐpl/sql developer

1.µ½http://www.oracle.com/technology/global/cn/software/tech/oci/instantclient/htdocs/winsoft.htmlÏÂÔØ
11.1.0.7.0 °æµÄ¼´Ê±¿Í»§¶Ë³ÌÐò°ü — Basic£¨²»ÊÇBasic Lite£©
2.½«ÏÂÔص½µÄÎļþ½âѹ£¬½âѹºóÎÒ½«Ä¿Â¼instantclient_11_1ÀïµÄÈ«²¿Îļþ¿½±´µ½ÁËÒ»¸öеÄĿ¼£ºE:\programs\OracleClient¡£ÄãÒ²¿ÉÒÔ²»¿½±´£¬Ö ......

ÈçºÎÓÃSQLÓï¾äÔÚÁ½¸öÊý¾Ý¿â¼ä¸´ÖÆ´æ´¢¹ý³Ì

 --1.ÔÚÄ¿±ê·þÎñÆ÷ÉϽ¨Á¢Èç϶ÔÏó(±»Í¬²½µÄ·þÎñÆ÷)  
   
  if   exists   (select   *   from   dbo.sysobjects   where   id   =   object_id(N'[sys_syscomments_bak]')   and   OBJECTPROPERTY(id,   N'IsUserTable')   ......

Java Ö´ÐÐ SQL ½Å±¾Îļþ

ÊÇ¿½±´µÄ±ðÈ˵ģ¬ÒÔ±¸Ñ§Ï°
package com.unmi.db;
import java.io.FileInputStream;
import java.io.InputStream;
import java.sql.Connection;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/**
* ¶ÁÈ¡ SQL ½Å±¾²¢Ö´ÐÐ
* @author Unmi
*/
pub ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ