sql count based on key id

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Matt Ashworth
    New Member
    • Oct 2011
    • 1

    sql count based on key id

    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_installe d
    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
    Last edited by Matt Ashworth; Oct 10 '11, 12:01 PM. Reason: to make the question clearer.
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    Join the two tables and use the aggregate count() grouping by the maker.

    Comment

    Working...