declare @CustomerID uniqueidentifier <P><BR>set @CustomerID = '129F1B78-5373-4196-BE92-253762896ADB' </P> <P> </P> <P><BR>select a.* from opvoucher a <BR>WHERE (a.customercode = @CustomerID or @CustomerID is null ) </P> <P> </P> <P><BR>select a.* from opvoucher a <BR>WHERE (a.customercode = @CustomerID) </P> <P> </P> <P>為何 前一句 where子句利用不到索引?</P> <P> </P>
請教一個sql問題,暫時放在首頁
慕碼人8056858
2018-12-03 17:13:23