Re: [sqlite] Question about expected query result??
On MS SQL Server 2000, one can pass a field name to the COUNT function, and though I haven't yet seen any difference in the results between the two, the queries run faster with COUNT(field) than with COUNT(*). COUNT(fieldname) provides the count of rows where the data in 'fieldname' is non-null. COUNT(*) provides the total count of rows: Ah. I guess that pretty much explains that. I seldom do counts without a WHERE clause of some sort that would preclude counting nulls in the first place. Thanks. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[sqlite] Question about expected query result??
I have the following table/data ClientIPClientDomain 63.149.28.33mail.serverlocation.com 63.149.28.33mail.serverlocation.com 63.149.28.33mail.serverlocation.com 63.149.28.33mail.serverlocation.com 211.141.67.7xmailserver.org 211.141.67.7xmailserver.org 211.141.67.7xmailserver.org 68.80.189.111 ravensorb 128.205.7.58acsu.buffalo.edu 66.35.250.206 sc8-sf-list1.sourceforge.net 128.205.7.57acsu.buffalo.edu 128.205.7.57acsu.buffalo.edu 128.205.7.57acsu.buffalo.edu 128.205.7.57acsu.buffalo.edu 128.205.7.57acsu.buffalo.edu 128.205.7.57acsu.buffalo.edu 128.205.7.57acsu.buffalo.edu 128.205.7.57acsu.buffalo.edu 128.205.7.57acsu.buffalo.edu 128.205.7.57acsu.buffalo.edu 68.85.92.99 eye-catcher.com When I run the following query, I get back 0 results -- anyone have any thoughts? I am expecting to get back 3 records. SELECT DISTINCT ClientIP, ClientDomain, COUNT(ClientDomain) AS ClientDomainCount FROM SMTPLog WHERE ClientDomainCount 1 GROUP BY ClientIP ORDER BY ClientDomainCount DESC, ClientDomain ASC