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

Çë½ÌÒ»Ìõ¿ìËÙ׼ȷµÄoracle²éѯÓï¾ä

ÔÚÒ»ÕűíaÖУ¬ÓÐ×Ö¶Îxm,sfzhm,rid,xb,mzµÈ6¸ö×ֶΣ¬Èç¹ûxmºÍsfzhmÏàͬ£¬ÄÇô¾Í˵ÕâÁ½Ìõ¼Ç¼Ïàͬ£¬Çë½ÌÔõô½«ÕâÖÖÇé¿öϵÄÊý¾Ý²éѯ³öÀ´¡£
SQL code:

select t.* from a t where exists(select 1 from
(select xm,sfzhm from a group by xm, sfzhm having count(1) >= 2) m
where m.xm = t.xm and m.sfzhm = t.sfzhm)
order by t.xm , t.sfzhm



Ö»ÓÐÒ»Ìõ¼Ç¼°É£¿ Õ¦ÅܳöÁ½Ìõ¼Ç¼À´ÁË£¿

Õâ¸ö¿ÉÒÔÓÃ×ÔÁ¬½Ó°É

select *
from table_name a,table_name b
where a.xm = b.sfzhm

ÒýÓÃ
SQL codeselect t.*from a twhereexists(select1from
(select xm,sfzhmfrom agroupby xm, sfzhmhavingcount(1)>=2) mwhere m.xm= t.xmand m.sfzhm= t.sfzhm)orderby t.xm , t.sfzhm


лл2Â¥£¬ÎÒÒªµÄ¾ÍÊÇÕâÖÖ½á¹û£¬ÓÉÓÚÎÒ¸Õѧoracle,Òò´Ë»¹Çë½âÊÍÏÂÕâÌõÓï¾ä£¬
select 1 from
(select xm,sfzhm from a group by xm, sfzhm having count(1) >= 2) m
where m.xm = t.xm and m.sfzhm = t.sfzhm£¬ÕâÌõÓï¾äÓе㸴ÔÓ£¬Çë½âÊÍÏ£¬Ð»Ð»¡£
ÁíÍâÄÜ·ñʹ²éѯËٶȸü¿ìµã£¿

ÒýÓÃ
SQL codeselect t.*from a twhereexists(select1from
(select xm,sfzhmfrom agroupby xm, sfzhmhavingcount(1)>=2) mwhere m.xm= t.xmand m.sfzhm= t.sfzhm)orderby t.xm , t.sfzhm


select1from
(select xm,sfzhmfrom agroupby xm, sfzhmhavingcount(1)>=2) mwhere m.xm= t.xmand m.sfzh


Ïà¹ØÎÊ´ð£º

javaÔõôÁ¬½ÓOracle£¬¼±°¡ - Java / JavaÏà¹Ø

private static final String URL = "jdbc:oracle:thin:@localhost:1521:orcl";
private static final String USERNAME = "sys";
private static final String PASSWORD = "s ......

Çë½ÌsqlÓï¾ä¡£ - Oracle / ¿ª·¢

ÎÒÓÐÒ»¸ö±í£¬½á¹¹ÊÇÕâÑù¡£
  ת³ö µ¥Î» תÈ뵥λ ±ÊÊý ½ð¶î
date(Ö÷) outid(Ö÷) inid(Ö÷) num amt
2009 1 2 1 500 Ϊ 1 µ¥Î» ÔÚ2009Ä ......

oracle 9i ×î½ü·¢Ïֵǽ±¨´í - Oracle / »ù´¡ºÍ¹ÜÀí

ÓÃPL/SQL µÇ½ʱµ¯³ö±¨´í´°¿Ú£¬´íÎóÈçÏ£¡
  ORA-01034:ORACLE not available
  ORA-27101:shared memory realm does not exist
ÇëÎÊ£¬ÓÐûÓÐÈËÓöµ½ÕâÖÖÇé¿ö£¬Ôõô½â¾ö£¿Ð»Ð»£¡

1. Oracle sid ÕýÈ ......

sqlÓÅ»¯ - Oracle / »ù´¡ºÍ¹ÜÀí

select count(1) from FX_RETURNBOOKCHECKLIST fxreturnbo0_ where fxreturnbo0_.BOOKID='164 ' AND fxreturnbo0_.RETURNID='00025.S0000001' 
ÉÏÃæÒ»¸ö¼òµ¥µÄSQL,Ö´ÐÐʱ¼ä2.6à ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ