Cast & convert is used to chenge the one data type to other data type.
example :select cast (200 as char)
example :
select convert (200 as char)
SUBSTRING FUNCTION
select substring(firstname,1,3) from table1
Print First name till 3 char
# Output :
'Tar'
Removing white spaces from the Right side
# select RTRIM(firstname,1,3) from table1
Removing white spaces from the Light side
example :
# select RTRIM(firstname,1,3) from table1
REPLACE FUNCTION
example :
# select REPLACE(firstname,'a','A') from table1
CONCAT
example :
# select concat(firstname,' ',lastname) Name from table1
ORDER BY :
example :defult accending
# select firstname from table1 order by fistname
example :
# select firstname from table1 order by fistname desc
IN:
select * from table where firstname in ('tom','dk')
No comments:
Post a Comment