Single-line function
Transform only one row returns a single result for each row
Single-line functions divide characters, values, dates, conversions, universal
Character functions: Casing control functions, character control functions
Capitalization control functions: Lower, Upper, initcap
Character control function: Concat,substr,length,instr,lpad|rpad,trim,replace
Lower,upper,initcap
Select lower (' SQL ') from dual;--results sqlselect Upper (' SQL ') from dual;--results sqlselect initcap (' sql COurs ') from dual;--result SQL Cours First Letter Capital
Concat,substr,length,instr,lapd|rpd,trim, replace
Select concat (' Hello ', ' world ') from dual; Results HelloWorld Select substr (' HelloWorld ', 1,4) from dual; Result Hell 4 characters from the first character select length (' Hellowrld ') from dual; Result 9 The character length */select InStr (' Helloword ', ' W ') from dual; Results 6 The first occurrence of the position of the W Select Lpad (Salary, ten, ' & ') from employees; Results &&&&&&2600 left Fill & Select Rpad (Salary, ' & ') from employees; Results 2600&&&&&& left Fill & Select Trim (' H ' from ' HHLLWOHLDHH ') from dual; Results llwohld go to the middle
Digital control Round,trunc,mod
Select Round (45.36954,4) from dual; 45.3695 Rounding Select Trunc (45.36954,3) from dual; 45.369 truncate SELECT mod (1600,300) from dual; 100 seeking remainder
Date control date can only be added minus Months_betwwen,add_months,next_day,last_day
Two date subtraction returns the difference between a date days
You can add or subtract a number of days to a date with a number except 24来
--Check the company's entry time is the last two days of each month staff select Last_name,to_char (hire_date, ' yyyy-mm-dd ') hdate from employees where hire_date=last_day (hire_date)-1
--Query for employees who have been in employment for more than 5 years by 2005, select Last_name,to_char (hire_date, ' Yyyy-mm-dd ') from Employeeswhere to_date (' 2005-12-31 ', ' Yyyy-mm-dd ')-hire_date >=5
Next month's Today (System time plus 1 months) Select Add_months (sysdate,1) from dual;
--Date after two days select Next_day (sysdate,2) from dual;
Oracle Learning Note Line function