我不明白在第二个代码中使用“^”的目的是什么? 另一个问题是,与第一个代码相比,我没有在第二个代码中检索正确的信息。为什么?
-- First code, use adventurework DW 2008
select FirstName, LastName from DimCustomer
where LastName like '[j-N]%'
order by LastName
-- Second code, use adventurework DW 2008
select FirstName, LastName from DimCustomer
where LastName like '[^L-N]%'
order by LastName
答案 0 :(得分:3)
^
表示字符在指定范围内不的位置。
这可能解释了为什么你没有得到你的结果呢?