IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

If we give the sub query as SELECT SQRT(144)


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
naveen_kumar

New User


Joined: 03 Dec 2005
Posts: 1
Location: coimbatore

PostPosted: Sat Dec 03, 2005 12:23 am
Reply with quote

if we give the sub query as SELECT SQRT(144) (or any other square numbers) <= the ans displayed is with an exponential type.

like for 144 must be 12 but ans displayed is +144.00000000+03
Back to top
View user's profile Send private message
reachsenthilnathan

New User


Joined: 20 Nov 2005
Posts: 15

PostPosted: Sat Dec 03, 2005 4:05 pm
Reply with quote

Hi,

I hope u mean to say that answer is +0.1200000000000000E+02 and not 12.
(thou u have given the answer as +144.00000000+03)

Use the following query to get it as integer.
SELECT CAST (SQRT(144) AS INTEGER) FROM SYSIBM.SYSDUMMY1;

Hope it helps.

Regards,
Senthil Nathan.R
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts RC query -Time column CA Products 3
No new posts Dynamically pass table name to a sele... DB2 2
No new posts Query on edit primary command CLIST & REXX 5
No new posts Query on edit primary command CLIST & REXX 1
No new posts SELECT from data change table DB2 5
Search our Forums:

Back to Top