Another way of writing instead of the LIKE statement in SQL

xiaoxiao2021-03-06  95

For example, find all users with "c", you can use USEDATABASE SELECT * from Table1 WHERE User Like '% C% "" Here is another way to complete the above features: use mydatabase selection * from table1 where charindex (' C ', UserName> 0 This method is theoretically more judging statement than the previous method, namely> 0, but this judgment process is the fastest, I want to believe that more than 80% of the operation is looking for characters. Strings and other calculations, there is no big deal with the charIndex function. It is also beneficial to use this method, that is, to%, | MyDatabase Select * from table1 where charindex ('%', username)> 0 can also be written: Use mydatabase select * from table1 where charIndex (char (37), username)> 0 ASCII characters is%

转载请注明原文地址:https://www.9cbs.com/read-122783.html

New Post(0)