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
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Why the difference between these two...

Author  Topic 

label
Posting Yak Master

197 Posts

Posted - 2003-02-17 : 10:37:11
I'm coming up with some odd results.

When I run this query:

select count(modelname) as cnt, modelname
from
smc_new_products.dbo.etechmodelrequests
where
interfacename like '%download%'
and
requestdatetime between '01/01/2001' and '02/16/03'
group by modelname
order by cnt desc

I return a record count of "69301" of rows that are empty/have no value. (Not Null)


When I run this query however:

select count(modelname) from etechmodelrequests
where modelname=' '
and requestdatetime between '01/01/2001' and '02/16/03'

I get a result of "73421"

I don't understand why the results would be different nor do I have any idea which number is correct?

Thanks



jsmith8858
Dr. Cross Join

7423 Posts

Posted - 2003-02-17 : 10:44:49
You don't have matching WHERE conditions in the two queries.



- Jeff
Go to Top of Page

label
Posting Yak Master

197 Posts

Posted - 2003-02-17 : 11:16:01
quote:

You don't have matching WHERE conditions in the two queries.



Sheesh. I knew I was missing something obvious. That's what I get for staying up to late watching my Babylon 5 dvds.

Thanks. :)

Go to Top of Page
   

- Advertisement -