sql創(chuàng)建臨時(shí)表語(yǔ)句 sql語(yǔ)句in后面跟的數(shù)據(jù)過(guò)多怎么解決?
sql語(yǔ)句in后面跟的數(shù)據(jù)過(guò)多怎么解決?解決辦法,使用臨時(shí)表:第一步:創(chuàng)建臨時(shí)表,并將in內(nèi)的數(shù)據(jù)插入到表中第二步:執(zhí)行in查詢select * from 表 where 列 in(select nu
sql語(yǔ)句in后面跟的數(shù)據(jù)過(guò)多怎么解決?
解決辦法,使用臨時(shí)表:第一步:創(chuàng)建臨時(shí)表,并將in內(nèi)的數(shù)據(jù)插入到表中第二步:執(zhí)行in查詢select * from 表 where 列 in(select num from #)第三步:銷毀臨時(shí)表drop table #若是連起來(lái)寫:set nocount onselect * into # from (select "1" num union all select "2" union all select "3" union all ..... select "N") aselect * from 表 where 列 in(select num from #)drop table #