I have a customer table, an item table and a transaction table with the following columns:
Customer - ID, Name
Item - ID, Description
Transaction - ID, CustID (Foreign key Customer(ID)), ItemID (Foreign Key Item(ID))
Using this query, can anybody help me create a query to answer the following question:
If a particular customer has participated in a transaction which involves a given ItemID (ie. the customer has bought a particular item), return a count of the total number of transactions that customer is involved in. The trick (and the part I cannot work out by myself) is how to include transactions in the count that do not involve the ItemID used in the query.