From: Martin Kleppmann Subject: 2+2 Date: 18 May 2005 at 15:04:56 BST To: Timothy Griffin The most straightforward solution: mysql> select 2+2; +-----+ | 2+2 | +-----+ | 4 | +-----+ 1 row in set (0.00 sec) The most obfuscated solution: mysql> create table x select '+' as a union select '='; select count(if( y.a=z.a,y.a,w.a))as'',min(y.a)as'',count(if(y.a!=z.a, z.a,w.a))as'',max( z.a)as'',count(*)as''from x y,x z left join x w on w.a!=y.a and y.a=w.a; Query OK, 2 rows affected (0.00 sec) Records: 2 Duplicates: 0 Warnings: 0 +---+------+---+------+---+ | | | | | | +---+------+---+------+---+ | 2 | + | 2 | = | 4 | +---+------+---+------+---+ 1 row in set (0.00 sec)