By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,663 Members | 762 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,663 IT Pros & Developers. It's quick & easy.

sql count based on key id

P: 1
I have 2 tables both have a primary key which links them,

How can I run a count query to look at the first table and check the id, then look at the second table and count up how many records have that same id?

table one
key - software_make
1 Adobe
2 Microsoft


table two

key - asset - Number_installed
2 11454 1
2 1245 1

so the result im looking for would show

Microsoft with number installed as 2

Hope this makes sense,
Thanks
Matt
Oct 10 '11 #1
Share this Question
Share on Google+
1 Reply


Rabbit
Expert Mod 10K+
P: 12,364
Join the two tables and use the aggregate count() grouping by the maker.
Oct 10 '11 #2

Post your reply

Sign in to post your reply or Sign up for a free account.