select * from tk_in00 where exists (select shop_id,alt_id from tk_inalert00 where tk_in00.shop_id=tk_inalert00.shop_id and tk_in00.in_id=tk_inalert00.alt_id)
Ôõô²éѯ³ö δ²åÈëµÄÊý¾Ý¼Ç¼select * from tk_in00 where not exists (select shop_id,alt_id from tk_inalert00 where tk_in00.shop_id=tk_inalert00.shop_id and tk_in00.in_id=tk_inalert00.alt_id)
exists
¸Ä³Énot exists²»¾Í¿ÉÒÔÁËô SQL code: select * from tk_inalert00 where not exists (select shop_id,alt_id from tk_in00 where tk_in00.shop_id=tk_inalert00.shop_id and tk_in00.in_id=tk_inalert00.alt_id)
ͨ¹ýNAME×Ö¶ÎÌõ¼þ²éѯһ¸öÊý¾Ý±í£¬¼ÙÉèÎÒÓÐ100¸öÐÕÃû£¬ÓÐÒÔÏÂÁ½¸ö·½·¨£¬ ·½·¨1£º °Ñ100¸öName ×é³ÉÒ»¸öSQLÓï¾ä£¬±ÈÈç Select * from tmp_table where Name='ÕÅÈý' or Name ='ÀîËÄ' Or ...Or Name='µÚÒ»°Ù¸öÐÕÃû' ......