I have a table that logs page views of each user:
+--------------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+--------------+--------------+------+-----+---------+----------------+
| view_id | int(11) | NO | PRI | NULL | auto_increment |
| page_id | int(11) | YES | MUL | NULL | |
| user_id | int(11) | YES | MUL | NULL | |
+--------------+--------------+------+-----+---------+----------------+
For every pair of users, I would like to generate a count of how many pages they have both looked at.
I simply do not know how to do this. : ) I am using mysql, in case it has a non-standard feature that makes this a breeze.