1.Top Query Statements
SELECT TOP n < column name table > from < table name > [Query condition]
Used to get the number of data bars returned by the rule.
SELECT TOP N PERCENT < list name > from < table name > [Query condition] Indicates the number of data bars for which the previous percentage was obtained.
2.LIKE operator
Query the records in the database by using a wildcard character.
_ Denotes matching with any single character
% indicates a match to a string containing one or more characters
[] matches any single character in a specific range (for example, [a-f]) or a specific set (for example, [abcdef]).
[^] or [!] Matches any single character other than a specific range (for example, [^a-f]) or a specific set (for example, [^abcdef]).
Escape identifier
For special characters appearing in strings: '% ', ' [', ' [] ', ' _ ' can use ' [] ' to include them, so that they are treated as ordinary characters.
Select 1 where ' aa_ssd ' like '%[_]% '
Use the characters immediately following the escape to make the escaped character. The character following the escape is equivalent to the escape character in the string ' \ '.
SELECT * from Test_course where name like '%\_% ' escape ' \ '
SQL Server Learning (2)