Entry
I have a customer DB and a transaction DB, how do I view a customer and their transaction history?
May 21st, 2001 17:21
Onno Benschop, Norton Seron, Ben Udall,
Given:
customer table
id name
--- -----
1 peter
2 paul
3 mary
transaction table
id customer action
--- --------- -------
1 1 added peter
2 1 phoned peter
3 1 sold dragon to peter
SELECT * FROM customer c,transaction t WHERE c.id=t.customer
You get:
c.id c.name t.id t.customer t.action
----- ------- ----- ----------- ---------
1 peter 1 1 added peter
1 peter 2 1 phoned peter
1 peter 3 1 sold dragon to peter