本文主要介紹sqlserver內(nèi)存數(shù)據(jù)庫(kù)(sqlserver存在函數(shù)),下面一起看看sqlserver內(nèi)存數(shù)據(jù)庫(kù)(sqlserver存在函數(shù))相關(guān)資訊。
這兩個(gè)函數(shù)差不多,但是因?yàn)閮?yōu)化方案不同,通常不會(huì)有更快的比,因?yàn)閮蓚€(gè)缺席的算法一起用不好,但是存在比存在好,因?yàn)橛眠@個(gè)的算法可能更多。例如,現(xiàn)在有兩個(gè)數(shù)據(jù)集,左邊是# temptable1,右邊是# temptable2?,F(xiàn)在存在以下問(wèn)題:1。兩個(gè)集合的交集。不屬于temptable1集合的# temptable2的設(shè)置首先創(chuàng)建兩個(gè)臨時(shí)表:創(chuàng)建表# temptable1(參數(shù)1 nvarchar(50),參數(shù)2 varchar(20),參數(shù)3 datetime,參數(shù)4 int);;insert # temptable1(參數(shù)1、參數(shù)2、參數(shù)3、參數(shù)4)值( 傳教士 , 13023218757,getdate-1,1);-1,1);insert # temptable1(參數(shù)1、參數(shù)2、參數(shù)3、參數(shù)4)值( 傳教士 , 23218757,getdate-2);insert # temptable1(參數(shù)1、參數(shù)2、參數(shù)3、參數(shù)4)值( 傳教士 , 13018757,getdate-3);insert # temptable1(參數(shù)1、參數(shù)2、參數(shù)3、參數(shù)4)值( 傳教士 , 13023257,getdate-4);insert # temptable1(參數(shù)1、參數(shù)2、參數(shù)3、參數(shù)4)值( 傳教士 , 13023218,getdate-5);-5);insert # temptable1(參數(shù)1、參數(shù)2、參數(shù)3、參數(shù)4)值( 傳教士 , 13023218,getdate- 6,6););insert # temptable1(參數(shù)1、參數(shù)2、參數(shù)3、參數(shù)4)值( 傳教士 , 13023218,getdate- 7,7););insert # temptable1(參數(shù)1、參數(shù)2、參數(shù)3、參數(shù)4)值( 傳教士 , 13023218,getda。te- 8,8);創(chuàng)建表# temptable2(參數(shù)1 nvarchar(50),參數(shù)2 varchar(20),參數(shù)3 datetime,參數(shù)4 int);;insert # temptable2(參數(shù)1、參數(shù)2、參數(shù)3、參數(shù)4)值( 傳教士 , 13023218757,getdate-1,1);-1,1);insert # temptable2(參數(shù)1、參數(shù)2、參數(shù)3、參數(shù)4)值( 傳教士 , 23218757,getdate- 10,10););insert # temptable2(參數(shù)1、參數(shù)2、參數(shù)3、參數(shù)4)值( 傳教士 , 13018757,getdate-3);insert # temptable2(參數(shù)1、參數(shù)2、參數(shù)3、參數(shù)4)值( 傳教士 , 13023257,getdate-4);insert # temptable2(參數(shù)1、參數(shù)2、參數(shù)3、參數(shù)4)值( 傳教士 , 13023218,getdate- 9,9););例如,我現(xiàn)在使用# temptable1和# temptable2的參數(shù)1作為引用1。兩個(gè)集合的交集:1) where是模式select * from # temptable2中的參數(shù)1(select # temptable 1參數(shù)1) 2)有模式select * from # temptable 2 t2 where exists(select * from # temptable 1 t 1,t1,t2參數(shù)1 =。論據(jù)1) 2。找到一組不屬于temptable1的# temptable2 1)在模式select * from # temptable 1 in argument 1 no(select # temptable 2 argument 1)2)模式select * from # temptable1 t1存在的地方不存在(select * from # temptable2 t2 in t1論據(jù)1 = t2。論據(jù)1)
了解更多sqlserver內(nèi)存數(shù)據(jù)庫(kù)(sqlserver存在函數(shù))相關(guān)內(nèi)容請(qǐng)關(guān)注本站點(diǎn)。