When I was working on a project recently, the customer had a need to fill in a few columns of the data queried from the database with a specific content, and use the NVL function to implement this function
The following is transferred from: https://www.cnblogs.com/yhoralce/p/6872121.html
Returns a non-null value from two expressions.
Grammar
NVL (EExpression1, EExpression2)
Parameters
EExpression1, EExpression2
If the eExpression1 evaluates to a null value, NVL () returns EEXPRESSION2. If the EExpression1 evaluates to a value other than NULL, the EExpression1 is returned. EExpression1 and EExpression2 can be any data type. If the result of both EExpression1 and EExpression2 is null, then NVL () returns. Null..
return value type
character, date, datetime, numeric, currency, logical, or null values
Description
You can use NVL () to remove null values from a calculation or operation in cases where null values are not supported or if NULL values do not matter.
Select NVL (a.name, ' empty ') as name from student a joins school B on A.id=b.id
Note: Two parameter types to match
1SELECTT.d_fdate,2T.vc_zhcode,3 NVL (SUM (T.f_fzqsz),0) F_price_b,4 NVL (SUM (T.F_FZQCB),0) F_cost_b,5 NVL (SUM (T.F_FGZ_ZZ),0) F_gz_b, 6 NVL (sum (T.f_fyzqsz), 0) f_price_y, 7 NVL (sum (T.F_FYZQCB), 0) f_ Cost_y, 8 NVL (sum (t.f_fygz_zz), 0) f_gz_y, 9 T.vc_source,10 Sysdate D_ Updatetime11 from gz_fund_gzb T
Such a judgment is important, because you do not know which line is not NULL, and do not know whether to perform operations on the cell next, so you can not fill the column with null, give it a 0, easy to view, but also easy to calculate.
Oracle NVL Functions