Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

select 2500 / 1000 Result = 2 ?

Status
Not open for further replies.

ahmet_sinav

Programmer
May 16, 2007
10
TR
hi all
i am making some calculations in my function like below
Code:
Code:
select x / t from tbl_q;
x = 2500 t=1000
Result = 2

its turning me 2 but i want 2.5
how can i solve this problem can u show me the way?
pg 8.2.4 platform windows.
Best Regards..
 
select (x/t)::number(15,2) from tbl_q;
is working true;
and your solution is working too.
tnks..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top