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

sql ÎÊÌâ - Oracle / ¿ª·¢

Select * from UserInfo where uif_UserCode in (1,12) 
ÓÃinÔÚÊý¾ÝÁ¿´óµÄʱºòЧÂʲ»¸ß£¬(1ºÍ12ÊÇ´«¹ýÀ´µÄÖµ)³ýÁËÕâÖÖ·½·¨»¹¿ÉÒÔÔõôд£¬
ÓÐÈË˵ÓÃexists µ½µ×ÒªÔõÃ´Ð´ÄØ ?
ÁбíÖµ²»¶à£¬ÓÃinÐÔÄÜҲɶ´ó²»Á˵Ä
ÆäʵÁбíÏî²»¶à£¬in ºÍexists²î±ðºÜС
Èç¹ûÒªÓÃexists±ØÐë´æÔÚÁíÒ»¸ö±íÖУ¬uif_UserCodeÉϽ¨Á¢Ë÷Òý¡£
Select * from UserInfo a where exists( select 1 from tempUserInfo b where a.uif_UserCode =b.uif_UserCode )

ÒýÓÃ
Select * from UserInfo where uif_UserCode in (1,12)
ÓÃinÔÚÊý¾ÝÁ¿´óµÄʱºòЧÂʲ»¸ß£¬(1ºÍ12ÊÇ´«¹ýÀ´µÄÖµ)³ýÁËÕâÖÖ·½·¨»¹¿ÉÒÔÔõôд£¬
ÓÐÈË˵ÓÃexists µ½µ×ÒªÔõÃ´Ð´ÄØ ?


in µÄ»°Ö»Òª·¶Î§²»´ó¸úexists¹Ø¼ü×ֲ¶à 

ÒªÊÇ·¶Î§´óµÄ»° ¿ÉÒÔ¿¼ÂÇexists,¿ÉÒÔ½¨Ë÷Òý°É
Select * from UserInfo a where exists(select 1 from UserInfo where a.UserCode=UserCode)

Select * from UserInfo where uif_UserCode in (1,12) 

¸Ä³É
Select * from UserInfo where uif_UserCode=1 or uif_UserCode=12

Íü¼ÇÄĸöЧÂʸßÁË£¬ºÇºÇ£¬ÄãÊÔÊÔ

ÒýÓÃ

Select * from UserInfo where uif_UserCode in (1,12)

¸Ä³É
Select * from UserInfo where uif_UserCode=1 or uif_UserCode=12

Íü¼ÇÄĸöЧÂʸßÁË£¬ºÇºÇ£¬ÄãÊÔÊÔ


´«µÄ1ºÍ12²»Êǹ̶¨µÄ£¬ÓпÉÄÜ»¹»áÊÇ3¸öÊý»òÕ߸ü¶àÄØ£¿

Èç¹û²»ÓÃexists»¹ÓÐʲô¸üºÃµÄ·½·¨Âð£¿

Select * from UserInfo where uif_UserCode=1 or uif_UserCode=12


Ïà¹ØÎÊ´ð£º

csvÎļþת»»³Ésqlµ¼Èëµ½Êý¾Ý¿â£¬Ã»ÓÐÊý¾ÝΪºÎ£¿

Ö´ÐеÄ˳Ðò£º
1£©Îļþä¯ÀÀ¿ò£¨Ñ¡ÔñÎļþʹÓã©
Ñ¡ÔñºÃÎļþºó
µã»÷Ò»¸öµ¼Èë°´Å¥µÄʱºò £¬°ÑÉÏÃæÉÏ´«¿òÀïµÄcsvÎļþÒÔÒ»¸öIDΪÎļþÃû£¬ÉÏ´«µ½**/**Îļþ¼ÐÏÂ
2£©¶ÁÈ¡Õâ¸öÎļþ¼ÐϵÄcsvµÄÎļþ£¬×ª»»³Ésql
3 ......

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

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

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

ÇóÒ»sqlÓï¾ä - MS-SQL Server / ÒÉÄÑÎÊÌâ

ÏÖÔÚÓÐÁ½ÕÅ±í£ºÎÄÕÂÖ÷±íA(articleId,articleTitle)£¬ÎÄÕÂÆÀÂÛ±íB(commentId,articleId,commentTitle)
ÏÖÔÚÎÒÏëʵÏÖÕâÑùµÄ¹¦ÄÜ£ºÁгöÎÄÕÂÁÐ±í£¬ÆäÖÐÿƪÎÄÕ±êÌâÏÂÃæÁгö´ËÎÄÕµÄǰ2¸öÎÄÕÂÆÀÂÛ£¬ÇëÎÊsqlÓï¾äÔõôд°¡ ......

sql ÎÊÌâ - MS-SQL Server / »ù´¡Àà

ÐèÇóÈçÏ£º
ѧԺ academy£¨aid,aname£©
°à¼¶ class£¨cid,cname,aid£©
ѧÉú stu(sid,sname,aid,cid)
סËÞÇø region(rid,rname)
ËÞÉáÂ¥ build(bid,rid,bnote) bnoteÊÇ¡®ÄС¯/¡®Å®¡¯
ËÞÉá dorm(did,rid,bid£¬bedn ......

sqlÓï¾äÎÊÌâ - MS-SQL Server / ÒÉÄÑÎÊÌâ

ÏÖÔÚÓÐÒ»¸ö²¿Ãűídept£¨²¿ÃÅÃû³Æ£¬²¿Ãźš£¡££©ÓÐÒ»¸öÈËÔ±±íemp£¨ÐÕÃû£¬ÈËÔ±±àºÅ£¬Ö°Î»£¬Ð½×Ê£¬²¿ÃÅ£©
emp±íÖеÄÄÚÈÝÊÇÕâÑùµÄ£º
a 1 ¹¤³Ìʦ 3000 Èí¼þ²¿
b 2 ÆÕͨԱ¹¤ 2000 Ó²¼þ²¿
c 3 ¹¤³Ìʦ 4000 Ó²¼þ²¿
d ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ