Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
251 views
in Technique[技术] by (71.8m points)

Converting decimal values to non decimal in computed column in oracle sql

I am trying to convert decimal values into non decimal number for a computed column in Oracle SQL.

Please see the below code. But I am not able to get the desired output. Query:

Select cast(cost_account)*100/cast(amnt_fin) as "computed_LTV" 
From Loan_app.

Here I Want a new column name as computed_LTV with the required calculation with no decimal in the output.

question from:https://stackoverflow.com/questions/66063392/converting-decimal-values-to-non-decimal-in-computed-column-in-oracle-sql

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

It is ROUND you're looking for, I presume.

SELECT ROUND (cost_account * 100 / amnt_fin) AS "computed_LTV" FROM Loan_app

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...