I have two tables, I am trying to join the result of a COUNT() for each row from another table.I have these two tables:tblProducts:ItemID | Info | InventoryCount1 | | 2 | | 3 | | tblInventory:ItemID | DateAdded1 | 1 | 3 |
This is the desired output:ItemID | Info | InventoryCount1 | | 22 | | 03 | | 1
This pseudo-SQL is roughly what I am attempting to do:SELECT *FROM tblProductsINNER JOIN ( SELECT COUNT(*) FROM tblInventory WHERE tblInventory.ItemID = tblProducts.ItemID)
I'm using SQL Server 2000, but would prefer to use ANSI SQL. Any suggestions are welcome.