Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB
ÈÈÃűêÇ©£º c c# c++ asp asp.net linux php jsp java vb Python Ruby mysql sql access Sqlite sqlserver delphi javascript Oracle ajax wap mssql html css flash flex dreamweaver xml
 ×îÐÂÎÄÕ : sql

SQLÓï¾äÌáÎÊ

ÏÖÓÐ±í  Term
½á¹¹ÈçÏÂ

time1 time2 idterm
2009-2-15 2009-6-30 11
2009-9-10 2010-1-15 12

Èç¹ûÊäÈë 2009-4-25 ÔòÓ¦¸ÃÈ¡³öidterm 11
Èç¹ûÊäÈë 2009-12-5 ÔòÓ¦¸ÃÈ¡³öidterm 12

Õâ¸öSQL¸ÃÔõôд£¿

·ÖÉÙÇë¼ûÁÂ
SQL code:

select idterm from tb
where time1<=ÊäÈë ......

SQLÓï¾äÕýÈ·µ«ÊÇRESULTSETÖÐûÓÐÖµ

StringBuffer str = new StringBuffer("select * from menu where parentid=1 and mid <>1 order by parentid");

List list = new ArrayList();
ResultSet rst = null;
DataBaseConnection dbc = null;
PreparedStatement pstm = null;

try {
dbc = new DataBa ......

sqlÊý¾Ý¸²¸Ç£¡

ÔõôʹÎÒÿ´Î²»ÊǸüÐÂÊý¾Ý¿â
¶øÊǸ²¸ÇÉϴεÄËùÓмǼÄØ£¡
ÒòΪÓÐʱºòʱ¼äÌõ¼þ²»Í¬
SQL code:

select * from hwouttb where
CAST(REPLACE(REPLACE(REPLACE(outdate,'Äê','-' ),'ÔÂ','-'),'ÈÕ','') AS DATETIME)
between
CAST(REPLACE(REPLACE(REPLACE('2007Äê10ÔÂ25ÈÕ','Äê','-' ),'ÔÂ','-'),'ÈÕ','') AS ......

Çë½Ìoracleµ¼³öµ½sql server2005

û¸É¹ýÕâÊ£¬Ò²²»ÖªµÀoracleÊý¾Ý¿âɶÑù£¬Çë½Ì´óϺÃǾßÌå²½ÖèÊÇʲô£¿ÐèҪעÒâЩʲô£¿
ÊÇÕû¸ö¿âµÄÊý¾Ý»¹ÊÇ±íµ¥?

Õæ¸öÊý¾Ý¿â

Õû¸öÊý¾Ý¿â£¬ÁíÍâÎÒÊÇ´Óһ̨װÓÐoracleµÄµçÄÔµ¼Èëµ½Áíһ̨װÓÐsql serverµÄµçÄÔÖС£¶àл£¡
ÒýÓÃ
ÊÇÕû¸ö¿âµÄÊý¾Ý»¹ÊÇ±íµ¥?



¸ÕgoogleÁËÏ£¬Ò²Ã»ÕÒµ½oracle µ¼ÈëSQL serverµÄ· ......

Çó½ÌÒ»¸öSql²éѯÎÊÌâ¡£

ÓÐÈý¸ö±íÒ»¸öÊDzɹºµ¥¸ñʽÈçÏÂ
Èë¿âµ¥±í£º

Èë¿âµ¥ºÅ      ²úÆ·        Öʼì±àºÅ      Èë¿âÊýÁ¿
001          Æ·ÖÖ1      Zj001        10
002          Æ·Ö ......

Ò»¸öSQLÓï¾äµÄÎÊÌâ¡£¸ßÊÖ°ï°ïæ

ÓÐÁ½¸ö±í¡£·Ö±ð¶¼ÓÐIDÖ÷¼ü¡£A±íµÄIDºÍB±íµÄIDÊǶÔÓ¦µÄ£¬¾ÍÊÇA±í¼¸¸öID£¬B±í¾Í¼¸¸öID¡£A±íµÄIDÊÇʲô,B±íµÄID¾ÍÊÇʲô¡£
¿ÉÊÇÏÖÔÚA±íµÄID±ÈB±íµÄ¶àÁË¡£
ÎÒÏÖÔÚÏëÒª°ÑB±íÖÐÉٵIJ¿·Ö¸ø²¹ÆëÁË¡£Õâ¸ö²åÈëÓ¦¸ÃÔõôд°¡£¿
SQL code:
insert into B(ID) select id from a where id not in (select id from b)

ÒýÓÃ
S ......
×ܼǼÊý:3315; ×ÜÒ³Êý:553; ÿҳ6 Ìõ; Ê×Ò³ ÉÏÒ»Ò³ [544] [545] [546] [547] [548] 549 [550] [551] [552] [553]  ÏÂÒ»Ò³ βҳ
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ