1. View partition size
Select segment_name, partition_name, Bytes/1024/1024 used_mb
From dba_segments
Where segment_name in ('tableone ',
'Tabletwo ')
2. Compare the data differences between the two tables
(Select * From Table1)
Minus
(Select * From table2)
3 '123' needs to be queried as in ('123', '123', '123'), but after a normal replace, a string is obtained, therefore, the following multi-line approach is adopted,
However, the SQL length is not as good as the SQL length.CodeAfter processing, you can get '123', '123', and '123' cost-effective.
Select Replace (regexp_substr ('20140901', '[^,] +', 1, level), ',', '') C1
From dual
Connect by level <= length ('20140901')-length (replace ('20160901', ',', '') + 1
4 Oracle 10g trim does not work
Regexp_replace (Param, '\ s *','')
5. Calculate the distance between two points based on coordinates
Earth_padius: = 6378137.0;
Radlat1: = 3.141592625 * LAT1/180.0;
Radlat2: = 3.141592625 * LAT2/180.0;
A: = radlat1-radlat2;
B: = 3.141592625 * lng1/180.0-3.141592625 * lng2/180.0;
S: = 2 * asin (SQRT (Power (sin (A/2), 2) + cos (radlat1) * Cos (radlat2) * power (sin (B/2 ), 2 )));
S: = S * earth_padius;
S: = round (S * 10000)/10000.0;
Return (s );