hey all
i need to find the birds with the largest number of habitats.
attached is the database i am working with.

i sort of need the solution in about 2hrs time....

thanx ali

Recommended Answers

All 3 Replies

sorry i forgot to add that i am using winsql and need the query.

Did you write your own query yet? If not, try it and post it here if you are having problems. Otherwise, do your own homework. We're here to help, not do your work for you.

yeh i have written my own code but not even sure if on right track...
Select H.HCode, Count (*)
From Birds B, Habitats H, Bird_Habitats BH
Where B.BirdID = BH.BirdID
Group By H.HCode, B.BirdID
Having Count (*) >= some (Select Count (*)
From Bird_Habitats
Group By BirdID);

and just for the record i wasnt trying to get u to do my homework for me i was purely trying to get help in understanding how to write this particular query!
thanx ali

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.