Avoiding full table scans

2005-06-30 Thread David Kagiri
Hi I our database there is one table that will grow into tetrabytes within a short time. I would like to know how i can reduce full table scans. I have used separate tables as per region for now but the problem is if i create a new table i am forced to recompile the application. I can easil

Combining several sum queries

2005-06-21 Thread David Kagiri
When i run the queries below they all work just fine SELECT sum(consultation)+ sum(laboratory) FROM nairobi,familymembers WHERE familymembers.dependantid = nairobi.memberid and familymembers.memberid = "AKI1" SELECT sum(consultation)+ sum(laboratory) FROM riftvalley,familymembers WHERE f

Subquery error

2005-06-16 Thread David Kagiri
i get an error when i run the query below though SQLyog. SELECT memberid,fullname FROM members WHERE memberid = (select distinct memberid FROM familymembers) the error is Error Code : 1064 You have an error in your SQL syntax. Check the manual that corresponds to your MyS