出于好奇,我想知道在使用=、in、like和语法时,是否存在速度/效率上的差异。= value;select field from table where field in (value);select field from table where field likevalue;select field from table where field matches value;
我搞不懂为什么有时候LIKE需要任何东西,而另一些时候它需要所有东西,这让我发疯。我觉得我应该能够在这两个条件下使用ANY (我正在尝试选择括号中任何regex表达式后面的记录)。出于某种原因,第一个LIKE和ANY都工作得很好--它返回所有带有狗食、血统或beneful的记录。
然而,第二个LIKE需要所有。否则,它不会遗漏关于款待、补给或湿的记录。但是为什么呢?where dsc_item like any ('%DOG CHOW%','%PEDIGREE%','%BE