Usage of the function oracle database

the SELECT * from the Tab;             // get all the table names in the current database user 
the SELECT  sys_guid () , UserName from TESTLIKUI;        // get the GUID of 

the SELECT  sys_guid ()  AS  " unique identification " , UserName AS  " username " , Password AS pwd   from TESTLIKUI;          // the GUID of after as an alias, sys_guid temporary database created for 

the SELECT  DISTINCT (password) as pwd from TESTLIKUI; 

the SELECT * from TESTLIKUI the WHERE AGEThe BETWEEN  20 the AND 30           // acquired data age 20-30, including 20 and 30 themselves 

SELECT  ABS (Age) from testlikui;        // ABS takes the absolute value 

SELECT username || ' + ' || Age AS the infos from testlikui; / / || connector, with the age and the username + connected, output 

SELECT  Lower (username) from testlikui;       // username in lowercase output, Upper uppercase output 

SELECT CreateTime, NEXT_DAY (CreateTime, ' Wednesday ' )from testlikui;         // the date createtime, access to future first Wednesday of the date (for the weekend, " Sunday " Sunday, the database does not recognize) 

the SELECT * the FROM testlikui                                                                  // SOUNDEX function returns a string representation of the argument in the speech, soundex consider a similar pronunciation character syllables, pronunciation so that the string comparison rather than comparing the letters, 
the WHERE   SOUNDEX (username) = SOUNDEX ( ' to ' );                                  // with the same pronunciation of some comparison (or similar), but different spelling words are very useful. 
                                                                                                   
SELECT username, VSIZE (username), length (username),                      // Although there are "fetch length", butLENGTH function result is "How many characters", VSIZE result is "how many bytes " 
CreateTime, the TO_CHAR (CreateTime, ' yyyy-mm-dd HH: mm: mm ' )              // The former is mainly the date, time, or the number of conversion text, where we put into the fixed date format of the output 
 from testlikui; 

SELECT username, substr (username, 2 , 2 ),                                          // target field username, beginning from the second interception, the interception of a string of two 
 substr ( username, 2 ),                                                                     // from the second start capturing, intercepts all back 
 substr (username, - . 1),                                                                   // reverse interception, the interception of the first countdown, all taken back 
  substr (username, - 2 )                                                                   // reverse taken, the first one taken from the reciprocal, back intercepts all 
 substr (username, - . 4 , 2 ) ,                                                                 // reverse interception, the interception of the reciprocal position 4, taken back two 
  substr (username, - 4 , . 5 )                                                                 // reverse taken, taken from fourth countdown, although taken back in claim 5, but actually, only 4, taken on all (four) 
 from testlikui 
Note:When only two parameters; whether it is positive or negative a few a few, are taken from the beginning who began intercepting all. 

// rownum pseudo column is set after acquiring a query result to a plus (a plus obtain a record rownum) 
 SELECT * from ( SELECT * from testlikui WHERE Age = 100 ) WHERE  rownum = . 1 ;      // Get age 100 , the first data 
 select * from ( select * from testlikui WHERE Age = 100 Order by username desc) WHERE  rownum = . 1 ;       // Get age 100, a first array of data names flashback 
 select* From testlikui WHERE Age = 100 and rownum <= 2 ;                               // Get age 100, the first data 

 SELECT * from testlikui WHERE username like  ' %% male ' ;                                       // fuzzy search, with "positive" data 
 SELECT * from testlikui the WHERE username like  ' t_ ' ;                                             // query, the name starts with t and followed by only one character

 

soundex renderings, obtain similar phonetic data (but the Chinese are not supported )

 

To_char date specified output format

 

Extract the specified output string substr

 

Guess you like

Origin www.cnblogs.com/likui-bookHouse/p/11227127.html