0% found this document useful (0 votes)
16 views1 page

STR Func

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views1 page

STR Func

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

SELECT COLUMN LIST FROM TABLENAME

ORDER BY COLUMN1 ASC/DESC,COLUMN2 ASC/DESC,.....

SELECT BusinessEntityID,JobTitle,BirthDate FROM HumanResources.Employee ORDER


BY BirthDate ASC
SELECT BusinessEntityID,JobTitle,BirthDate FROM HumanResources.Employee ORDER
BY BirthDate DESC

SELECT BusinessEntityID,JobTitle,BirthDate FROM HumanResources.Employee ORDER


BY JobTitle ASC,BirthDate DESC

SELECT DISTINCT JOBTITLE FROM HumanResourceS.Employee ORDER BY JobTitle

SELECT TOP 10 BusinessEntityID,JobTitle,BirthDate FROM HumanResources.Employee


ORDER BY BirthDate ASC
SELECT TOP 10 PERCENT BusinessEntityID,JobTitle,BirthDate FROM
HumanResources.Employee ORDER BY BirthDate ASC

SELECT ASCII('A')
SELECT CHAR(97)

SELECT LOWER('ABC')
SELECT upper('sql server')

SELECT len('sql server')


SELECT lower(JOBTITLE) FROM HumanResourceS.Employee ORDER BY JobTitle

SELECT left(JOBTITLE,3) FROM HumanResourceS.Employee ORDER BY JobTitle


SELECT right(JOBTITLE,2) FROM HumanResourceS.Employee ORDER BY JobTitle

SELECT substring(JOBTITLE,3,2) FROM HumanResourceS.Employee ORDER BY JobTitle

select REPLICATE('#',10)
SELECT reverse('sql server')

SELECT REPLACE('abcdefghicde','cde','xxx');

SELECT STUFF('abcdef', 2, 3, 'ijklmn');

SELECT RTRIM('Removes trailing spaces. ') + 'Next';

You might also like