Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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)


Ò


Ïà¹ØÎÊ´ð£º

¹ØÓÚgroup byµÄsqlÓï¾ä£¿

  with adod_dict do
    begin
    close;
    commandtext:='select bgqxcode,count(*) wjsl from wscl_wsda_file where wjnd=:tnd group by bgqxcode'; ......

sql²éѯÒÉÎÊ

±íÖа´datadate,tradeidΪÖ÷¼ü£¬Ò²¾ÍÊÇ˵tradeid»áÖØ¸´³öÏÖÔÚ²»Í¬ÌìÖУ¬Í¬Ò»ÌìµÄtradeidÊDz»Í¬µÄ¡£ÏÖÔÚÎÒÏ£Íûȡһ¶Îʱ¼ä·¶Î§ÄÚ²»Öظ´µÄtradeid£¬ÇÒֻҪÿ¸ötradeidµÄ×îºóÒ»´Î³öÏÖµÄÄÇÌõ¡£sqlÓï¾ä¸ÃÔõôд

£º ......

¼òµ¥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Ô¡ÑÎ(É ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ