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

Çë½ÌÒ»¸öSQL²éѯ

ÓÐÈçÏÂÁ½¸ö±í
tb1
col  col1
abc  111 
cde  111 
qaz  222   
tgb  222

tb2
col2  col3
abc    111 
qaz    222 

ÎÒÔõô²éѯTB1±íÄÄЩÊý¾ÝÔÚTB2±íÊÇûÓеÄ
select  *  from TB1  where not  exsits  (select  *  from  TB2)

SQL code:
select * from tb1 where not exsits (select * from tb2)


SQL code:
select * from tb1 where not exists (select * from tb2)


¿ÉÄÜÃèÊö´íÁË£¬ÕâÁ½¸ö±íÓ¦¸ÃÊÇÕâÑùµÄ
ÈçÏÂ:
tb1
guid  col  col1
dadf  abc  111
1erw  cde  111
21qe  qaz  222 
qweq  tgb  222

tb2
guid  col2  col3
w5wr  abc    111
w34f  qaz    222 


SQL code:
select * from tb1 where not exists (select * from tb2 where tb1.col=tb2.col2 and tb1.col1=tb2.col3)


Ò


Ïà¹ØÎÊ´ð£º

SQL serverÊý¾Ý¼¯³ö´íÇóÖú

Á½ÖÖ´íÎó£º
1.Èç¹ûÎÒÕâÑùÉêÃ÷£ºResultSet rs;´íÎóÌáʾÈçÏ£º

An error occurred at line: 51 in the jsp file: /index.jsp
The local variable rs may not have been initialized
48:    ......

×Ü»áÅöµ½¹ÖµÄÎÊÌ⣬sqlÎÊÌâ

sql2005
select *from v_ddxx where d_sfsc='0' and (g_ssbm='1001' or g_ssbm='1002') and (xxf>0 and  xxfwzf <>0 ),Ö´ÐÐËÙ¶ÈÂýµÄÒªËÀ£¬µ«ÊÇÈç¹û°Ñ(xxf>0 and  ......

¼òµ¥SQLÓï·¨

SELECT A.barcode, A.number, B.goodsname
from pandian AS A INNER JOIN
      baseinfo AS B ON A.barcode = B.barcode


ÏÖÔÚ£º
4961557110306 1 Elsan  Bath chanmÔ¡ÑÎ(É ......

sql ´æ´¢¹ý³ÌÎÊÌâ

SQL code:
declare @t varchar(5000)
set @t=''
select @t=@t+',[È¡Ïû·ÖÎö-'+quXiaoFenXi+']=sum(case when [quXiaoFenXi]='+quotename([quXiaoFenXi],'''')+' then shangPinZongShu else 0 end)'
from tb_gyyD ......

ÇósqlÎÄ

ÇóA != 1 and B != 2 ÒÔÍâµÄ¼Ç¼
a!=1 and b!=2 ÒÔÍ⣿

ÄÇÆñ²»ÊÇa=1»òÕßb=2µÄÕâÖÖÇé¿öô

select * from table where a = 1 or b = 2

Èç¹ûÊÇA != 1 and B != 2µÄ»°
select * from table where a ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ