MS-SQL > Not in °ú Not exists µî·ÏÀÏ : 2017-06-30 17:08 Á¶È¸¼ö : 52,547Â÷ÁýÇÕ (except, minus)
¾Æ½±Áö¸¸ ÀÌ·±ÇÔ¼ö´Â sql¿¡ ¾ø½À´Ï´Ù. Analysis Services¿ëÀ¸·Î´Â ÀÖÁö¸¸ t-sqlÇÔ¼ö´Â ¾Æ´ÏÁö¿ä) ±×·³ ÀÌ·±°æ¿ì´Â ¾î¶»°Ô ÇÒ±î¿ä ? -> not in À̳ª not exists ¸¦ ÀÌ¿ëÇϴ°̴ϴÙ. ¶Ç´Â outer joinÀ» »ç¿ëÇϴ°ÍÀÔ´Ï´Ù. 1. not in »ç¿ë select * from Å×À̺í¸í where Çʵå¸í not in ('aaa') select * from Å×À̺í¸í where id not in (select id from Å×À̺í¸í) 2. not exists »ç¿ë select * from Å×À̺í¸í where Çʵå¸í not exists ('aaa') select * from Å×À̺í¸í where not exists(select * from Å×À̺í¸í y where y.id=x.id) µµ¿òÀÌ µÇ¼Ì±æ ¹Ù¶ø´Ï´Ù.
|