sql service analysis database

 
 
- Society of communication Hythe
https://blog.csdn.net/blackfwhite/article/details/80382849
- Variable Institute variables 
All the records. 



Contain special characters SQL query contains field contents underscore * WHERE ename the FROM scott.emp the SELECT like '% \ _%' Escape '\'; the SELECT * WHERE REGEXP_LIKE scott.emp the FROM (ename, '_'); Wildcard Description % replacement of one or more characters _ substitute only one character [the charlist] character string and any single character [^ charlist] or [! the charlist] is not in a character column of any single character to "a" or "L" or "N" beginning with WHERE City LIKE '[ALN]% ' not with "a" or "L" or "N" beginning with WHERE City LIKE '[! ALN] %' comprising "lond" the WHERE City LIKE '% lond%' to "Ne" starting WHERE City LIKE 'Ne% ' in the multi-valued query WHERE LastName iN (' Adams', 'Carter') */ --select top 50 * from SMInvoiceDetail where ChangeTime > '2017-06-25' and ChangeTime <= '2017-06-26' --select top 1000 * from table order by 列 asc --select top 1 * from SMHistory_InvoiceDetail where HistoryDetailID > 400 --select top 50 * from SMInvoiceHeader order by BDBillNo asc /* SELECT Persons.LastName, Persons.FirstName, Orders.OrderNo FROM Persons FULL JOIN Orders ON Persons.Id_P=Orders.Id_P ORDER BY Persons.LastName */

 

The SQL LIKE operator, wildcards, innocently tell the regular expression 
in SQL There are four common wildcard 
a '%' he may alternatively 0 or more characters, different action in different positions 

syntax :( illustrate it, more illustrate the point) 
F: 
1. the SELECT Student from the above mentioned id the WHERE name like '% Li' '(expressed Find all name' Lee 'beginning 
2. select id from student where name like '% Lee% '' (expressed Find all middle name 'Lee''s) 
3. the SELECT Student from the above mentioned id the WHERE name like '% Li' '(represented find all the names at the end there' Lee ''s) 
two .'_' he is to replace any single character, and different positions in effect, similar to the usage and '%', not go into here 

three '[]', which put an arbitrary character string, the number is not limited to, any of the characters in parentheses represent numbers satisfying. 

Note: the above and two different the wild card is no longer used in conjunction with LIKE, he is a regular contents inside, all usage is slightly different, to add to his front regexp keyword 
F: select id from student where name regexp '[ Li Wang]' 
representation Find all the names appearing in 'Lee' Or 'Wang' any student id 

IV. '[!]' (Also written as [^]) which put arbitrary character string, the number is not limited, except satisfied by any character within the brackets, above which a contrast, but the use of similar , not repeat them here. 
--------------------- 
author: qq_42806214
Source: CSDN
Original: https: //blog.csdn.net/qq_42806214/article/details/82354232 
Copyright: This article is a blogger original article, reproduced, please attach Bowen link!

  

Guess you like

Origin www.cnblogs.com/--3q/p/10936221.html