Yay, xkcd
17 October 2008
17 October 2008
30 May 2008
7 April 2008
4 February 2008
+ R.Local Policies/Security Options”.24 September 2007
10 May 2007
8 May 2007
person_id |
transaction_id |
|---|---|
| 1 | 1 |
| 2 | 1 |
| 1 | 2 |
| 1 | 3 |
SELECT `person_id` FROM ( SELECT `person_id` FROM `table` WHERE `transaction_id` IN (1, 2) ) AS `people` GROUP BY `person_id` HAVING COUNT(`person_id`) = 2
SELECT returns all those people that have been in either of the two transactions. The second groups the people, and selects those that appear twice — in other words, those that were in both transactions. It looks so simple in hindsight!SELECT by using GROUP_CONCAT(), but that loses some of the functionality — as well as the elegance.
3 May 2007 | 3 comments
30 April 2007
recent:username@gmail.com”, rather than the usual “username@gmail.com”. This is apparently automatic on mobile devices, but I don’t see why it’s not the default…
20 April 2007