Click here to Skip to main content
15,867,453 members

Comments by kalyan10qwerty (Top 38 by date)

kalyan10qwerty 22-Feb-16 5:11am View    
select count(*) from Students s, Organisations o, Classes c
where s.ClassId=c.Id and c.OrganisationId=o.Id and o.OrganisationCode='204050'

above is the query for which i got student count as i specified the particular organisation code.
I have around 800 org so please give me the solution
kalyan10qwerty 22-Feb-16 4:56am View    
select o.organisationcode, o.organisationname, ( select count(*) from Students s,Classes c,Organisations o where s.ClassId=c.Id and c.OrganisationId=o.Id ) as StudentCount from Organisations o,Students s,Classes c
where s.ClassId=c.Id and c.OrganisationId=o.Id

In studentCount it is retrieving all organisation students count in-stud of that particular org student count :(. Some where i am missing the condition. Unable to figure it out. So help me
kalyan10qwerty 22-Feb-16 4:33am View    
yes your right. but i am unable to write complete query even though after referring to the information provided by you. so give me the solution
kalyan10qwerty 22-Feb-16 4:22am View    
Hi OriginalGriff

I have tried half query
select count(*) from Students s,Classes c,Organisations o where s.ClassId=c.Id and c.OrganisationId=o.Id

now i need orgname which is in orgtable along with the above query so please help me
kalyan10qwerty 2-Mar-15 3:45am View    
I have already done that then it is saying
The best overload method match for 'System.Data.OleDb.OleDbCommand(string, System.Data.OleDb.OleDbConnection) has some invalid arguments

So plz give another solution