In SQL, I have col1
and col2
. Both are integers.
I want to do like:
select col1/col2 from tbl1
I get the result 1
where col1=3
and col2=2
The result I want is 1.1
I put round(col1/col2,2)
. The result is still 1.
I put decimal(col1/col2,2)
. The decimal is not built in function.
How can I do exactly to get 1.1?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…