2--Mathematical function 3 Select CEILING (COUNT (*)/5.0) from news--take the smallest integer greater than the result 4 select floor (COUNT (*)/5.0) from news--take the maximum integer less than the result 5 sel ECT SQRT (2)--Value open square 6 Select ROUND (3.45645,2) 7 Select ABS (-5): Absolute value function, take the absolute value of this number, can be applied to some chaotic values in the database of the addition and subtraction operations. 8 9--string function LOWER (' RGFRG ')--uppercase letters changed to lowercase letter by select LOWER (' Ggfgrt ')--lowercase letters to uppercase letters, select LTRIM ()--remove left word spaces lattice sel ECT RTRIM ()--Remove the right-hand space of the string, select Left (title,5) from news--the length of the string to intercept from a column (title,5) from news--a string from the right side of a column. Select SUBSTRING (title,3,5) from news--to intercept several characters from the first few characters of a column. Select REVERSE (Title) from News- -Flip a column select CHARINDEX (' China ', title) from News--the query target content does not appear in the specified area and appears in the location of the Select REPLACE (Title, ' China ', ' us ') from news--the replacement string. Example searches for keywords and significantly selects STUFF (title,3,4, ' Chine ') from News22 other functions (RAND () CEILING)--randomly generated numbers between 1 The range of random numbers can be multiplied by the number of select LEN (' Chine ')--take a string length of GETDATE ()--Gets the current time. Select year (sbirthday) from student--time of year Select Month (sbirthday) from student--date Time month (Sbirthday) from student3--take time daysElect datepart (Yy,sbirthday) from student4--Yy,mm,dd, respectively, represents the date of the year, and the select cast (' 123 ' as int)--Converts the string
General functions of the database (mathematical functions, String functions, other functions)