Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

In QotD, posted on Aug 6 on ROWCOUNT and table variable Expand / Collapse
Author
Message
Posted Friday, August 27, 2010 3:45 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Yesterday @ 4:40 PM
Points: 157, Visits: 289
Hi,
Pls help me on this. In QotD, question posted on Aug 6 on ROWCOUNT, the answer in infinite loop. ie, the condition @i <> 1 always is true . But another sample query as shown below gives expected result which contradicts from while loop.

DECLARE @i float
set @i = .9
set @i = @i + .1

-- Query 1
if @i <> 1
print 'Yes'
else
print 'No'

Answer: No

-- Query 2
if @i = 1
print 'Yes'
else
print 'No'

Answer: Yes

Can anyone pls explain on difference in this two.
Post #976247
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse