Quantcast
Channel: VBForums - Database Development
Viewing all articles
Browse latest Browse all 2918

How to query for a list of row counts

$
0
0
I am a novice at SQL queries and I would like to know if what I describe can be done simply.

Here's a hypothetical. Consider I have a table of SalesReps and in it is a column of ID which is unique. I also have a table of Sales and in it is the column SalesRep as a foreign key in a one to many relationship. I would like to run a query that would contain two columns, SalesRepID and NumberOfSales. Number of sales would be the quantity of rows (sales) for that sales rep.

If this can be done simply can you point me to a concept or tutorial online to learn how to do it? I should just learn a lot more SQL but I don't have time at the moment so I'm hoping someone can point me to the concept I need to learn. If I knew what it was called I could just search for it myself. And of course an example would also be greatly appreciated.

Viewing all articles
Browse latest Browse all 2918

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>