Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Query keeps returning slightly different results

Author  Topic 

Grifter
Constraint Violating Yak Guru

274 Posts

Posted - 2015-02-09 : 06:33:42
Hi

I have a query with a nested query that is used as an in line view. When I run the whole query I keep getting slightly different results each time (10000, 10002, 10001, 9999 etc.), nothing is being changed, no jobs are running on the DB to affect the tables etc.

When I run the inline view query with the nested query, or nested query on its own, it returns same number each time.

What could potentially be the cause of this?

Using SQL Server 2008 R2 Express Edition on local W7 PC


G

Grifter
Constraint Violating Yak Guru

274 Posts

Posted - 2015-02-09 : 07:13:42
It was because I was using rank of row ID and order by a date but not the time field as well for sub query within inline view. this was causing returned results from outer query to be somewhat random.
Go to Top of Page
   

- Advertisement -