chpicker
Programmer
- Apr 10, 2001
- 1,316
Well, I'm still not getting it. Here's an example of what I want to accomplish.
I have 2 tables. The second has many records for each record in the first, and both are indexed on the controlling field. How would I make a Select statement that would get me one record for each record in the first table and a COUNT of the number of matching records in the second table? Say the first table has 1500 records and the second has 60000 records. The query results should give me 1500 records, each with a count of the number of matching records from the second table.
Every way I've tried has only yielded one record with a count of around 58000. Any ideas how to do this?
I have 2 tables. The second has many records for each record in the first, and both are indexed on the controlling field. How would I make a Select statement that would get me one record for each record in the first table and a COUNT of the number of matching records in the second table? Say the first table has 1500 records and the second has 60000 records. The query results should give me 1500 records, each with a count of the number of matching records from the second table.
Every way I've tried has only yielded one record with a count of around 58000. Any ideas how to do this?