首页 > 代码库 > 字付串函数 substring(ex,star,end)

字付串函数 substring(ex,star,end)

 1 --substring(ex,star,end)
 2 SELECT SUBSTRING(Name, 1, 2) AS ProductName, ListPrice  
 3 FROM Production.Product order by ProductName
 4 
 5 SELECT Name FROM Production.Product order by Name
 6 
 7 select * from Production.Product
 8 
 9 
10 SELECT SUBSTRING(Name, 1, 6) AS ProductName, ListPrice  
11 FROM Production.Product 
12 WHERE  ListPrice LIKE 3%;  
13  
14 
15 SELECT SUBSTRING(Name, 1, 30) AS ProductName, ListPrice  
16 FROM Production.Product  
17 WHERE CONVERT(int, ListPrice) LIKE 3%;  

 

字付串函数 substring(ex,star,end)