oracleÊý¾Ý²éѯÎÊÌâ
ÓÐ500ÍòÌõͨ»°¼Ç¼
±àºÅ ºÅÂë ±»½ÐºÅÂë ¿ªÊ¼Ê±¼ä ½áÊøÊ±¼ä ͨ»°Ê±³¤
1 10010 20020 12:00 12:01 1
2 10010 20045 12:05 12:06 1
3 10012 30045 12:45 12:55 10
Êý¾Ý²»ÊǺÜÕýÈ·
²éѯҪÇó: ²éѯͬһµç»°ºÅÂëÁ½´Îͨ»°¼ä¸ô´óÓÚ10ÃëµÄËùÓбàºÅ (Êý¾ÝûÓÐÃë×Ô¼ºÌí¼Ó)
·ÖÎö:10010¿ÉÄÜÓÐÎå´Îͨ»°,¼ÓÈëµÚËĴνáÊøÓëµÚÎå´Î¿ªÊ¼Ê±¼ä¼ä¸ô´óÓÚ10ÃëÄÇôÕâÌõÊý¾Ý¾Í·ûºÏ
µÚËĴνáÊø£¬µÚÎå´Î¿ªÊ¼ÔÚÄÄÀïÄØ£¿
Äã¸øµÄÊý¾ÝºÍ˵Ã÷¶¼Ã»½âÊÍÇå³þŶ£¬»¹ÊÇÎÒ¿´²»¶®¡£
Êý¾ÝûÓÐÃë×Ô¼ºÌí¼Ó
Ôõô¸öÌí¼Ó¹æÔò£¿
»òÕß
select * from table1 t
where not exists(
select 1 from table1
where ºÅÂë=t.ºÅÂë and ¿ªÊ¼Ê±¼ä-t.½áÊøÊ±¼ä between 0 and 10/24/3600)
and exists(
select 1 from table1
where ºÅÂë=t.ºÅÂë and ±àºÅ>t.±àºÅ)
drop table tb_mumu;
alter session set nls_date_formate='yyyy-mm-dd hh24:mi:dd';
create table tb_mumu (
ID number primary key not null,
Ö÷½ÐºÅÂë varchar2(11) not null,
±»½ÐºÅÂë varchar2(11) not null,
ͨ»°¿ªÊ¼Ê±¼ä d
Ïà¹ØÎÊ´ð£º
±¾À´ÒªÐ´¸öupdateÓï¾ä
update table_a A
set A.flag=1
where A.id in (select B.id from table_b B)
½á¹ûÎóд³É
update table_a A
set A.flag=1
where ......
ÏÖÔÚÓÐÒ»ORACLEÖеÄSQLÓï¾ä£¬ÐèÒªÒÆÖ²µ½DB2ÖУ¬ÇëÎʸÃSQL¸ÄÈçºÎд
ORACLEÖУº
select floor(months_between(date1,date2)) from A
date1,date2·Ö±ðΪ±íÖеÄÁ½¸ö×Ö¶Î £¬¶¼ÎªÈÕÆÚÐÍ
DB2ÖÐÈçºÎʹÓÃÐ ......
exp user/password@dbname file=c:\table.dmp tables=jbitaku,jbitakum grants=y
È»áá°´»Ø車鍵 說Ã÷:¡¡ user/password@dbname ¡¡·Ö別±íʾÓÃ戶Ãû£¬ÃÜ碼ºÍ·þ務Ãû f ......
Developer SuiteÁ¬½ÓÊý¾Ý¿âµÄÎÊÌ⣬ÀͼݸßÊÖÖ¸µã£¡
µçÄÔÀïÃæÍ¬Ê±×°ÁËOraHome92ºÍDevSuiteHome2£¬Ç°ÕßµÄsql*plusÄÜ·ÃÎÊ£¬ºóÕßµÄÔò²»ÐС£ÊäÈëscott/tigerµÇ½ºóÕßʱ£¬ÎÒÊäÈëÁË"Ö÷»ú×Ö·û´®"ºÅÒԺ󣬱¨´í£º&n ......