sql創(chuàng)建臨時表語句 sql語句in后面跟的數據過多怎么解決?
sql語句in后面跟的數據過多怎么解決?解決辦法,使用臨時表:第一步:創(chuàng)建臨時表,并將in內的數據插入到表中第二步:執(zhí)行in查詢select * from 表 where 列 in(select nu
sql語句in后面跟的數據過多怎么解決?
解決辦法,使用臨時表:第一步:創(chuàng)建臨時表,并將in內的數據插入到表中第二步:執(zhí)行in查詢select * from 表 where 列 in(select num from #)第三步:銷毀臨時表drop table #若是連起來寫: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 #