1. Knowledge of Union
Select one from Dualunion select one from dual
And
Select one from Dualunion allselect one from dual
The effect of union is to merge query results all to keep duplicate rows
2. Knowledge of ORDER BY
2.1 Select T.*fromorderby1,2
--Sort By column number
2.2 SelectT.*, T.rowid fromUsers TOrder byT.name Nulls First
-- This field is preceded by a null value
SelectT.*, T.rowid fromUsers TOrder byT.name Nulls Last
-- This field is followed by a null value row
2.3 Select T.*from thewherein ('admin',' test2',' test ')order by InStr ( 'admin,test2, test ', T.name)
--Sort by in order
2.3.1 Select T.*fromorder by InStr (' admin, test2 , Test 'desc
--Sort PS in order: at the bottom of the line. You can adjust the values in the InStr as required
3. About Base64-bit database encryption and decryption knowledge
Select utl_raw.cast_to_varchar2 (Utl_encode.base64_decode (Utl_raw.cast_to_raw ('mteumg== 'as from-- decryption result 11.2
Select utl_raw.cast_to_varchar2 (Utl_encode.base64_encode (Utl_raw.cast_to_raw (11.2from --mteumg==
4. Oracle MoD uses a number that is divisible by M within n
SelectT.rnum from(SELECTRowNum Rnum fromAll_objectsWHEREROWNUM<= Ten) TwhereMoD (T.rnum,3)=0 ; --number of results divisible by 3 within 10 3,6,9 Select sum(T.rnum) asTotal_sum from(SELECTRowNum Rnum fromAll_objectsWHEREROWNUM<= Ten) TwhereMoD (T.rnum,3)=0 ; --and results of the numbers divisible by 3 within 10
Usage of 5.Oracle decode
SelectDecode (AA,' One','data is one',' A','data is','Other data') as"Data Results" from(Select One asAa fromDualUnion AllSelect A fromDualUnion AllSelect 221 fromDualUnion AllSelect 333 fromdual)
Start with usage of 6.Oracle
SelectT.* fromSys_tree TwhereT.isdel=1Start withT.code=' -'Connect byPrior t.id=T.pidOrder byT.orderno--Querying all child nodes SelectT.* fromSys_tree TwhereT.isdel=1Start withT.code=' -'Connect byPrior t.pid=t.idOrder byT.orderno--querying all parent nodes
Database knowledge (mainly based on oracle,sql for reference)