Hi all,
I have a database structure of :
Code:
CREATE TABLE /*!32312 IF NOT EXISTS*/ `bilgiler` (
`kayitID` int(11) NOT NULL AUTO_INCREMENT,
`hak_sahibi_id` bigint(15) DEFAULT NULL,
`cinsiyet` tinyint(1) DEFAULT NULL,
`dogumtarihi` date DEFAULT NULL,
`islemtarihi` date DEFAULT NULL,
`tanikodu` varchar(10) DEFAULT NULL,
`tedavi_ili` tinyint(3) DEFAULT NULL,
`dogum_ili` tinyint(3) DEFAULT NULL,
`ikamet_ili` tinyint(3) DEFAULT NULL,
PRIMARY KEY (`kayitID`)
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=latin5;
I created an ASP loop for i = 0 to 65 executing the following query of
Code:
Select count(distinct hak_sahibi_id) as hebele from bilgiler where year(islemtarihi)-year(dogumtarihi) ='" & i & "' and (islemtarihi between '2007-07-01' and '2008-06-30')
So it must count the records with distinct of hak_sahibi_id.
When I take the sum of the query results the number I get is nearly two times larger than the result of general query which is
Code:
Select count(distinct hak_sahibi_id) from bilgiler
General query has a result of : 115.640
And the sum of the loop results is : 217.752
Any idea what the problem is? (Problem does not seem like ASP loop problem as I get the same results if I type the queries manually).
Please help
telmessos