1. The origin of the problem
When the Oracle database field value is less than 1 decimal, processing with the char type loses 0 of the preceding decimal point
For example, 0.35 becomes. 35
2. Solution: Format digital display with To_char function
Select To_char (0.338, ' fm9999999990.00 ') from dual;
Results: 0.34
The focus here is to see fm9999999999.99, which means that the integer part is up to 10 bits, the decimal part is 2 BITS, FM means to remove the front space after the turn string, without adding fm,0.34 before there will be spaces.
Use of 3.with
With TMP1 as (
SELECT 1 as A, 2 as B from DUAL
UNION
SELECT 1 as A, 3 as B from DUAL
UNION
SELECT 1 as A, 4 as B from DUAL
),
TMP2 as (
SELECT 1 as A, 2 as B from DUAL
UNION
SELECT 1 as A, 3 as B from DUAL
UNION
SELECT 2 as A, 4 as B from DUAL
)
SELECT tmp1.*,tmp2.*
From TMP1 JOIN TMP2
On TMP1. A = TMP2. A