Please consider the following table 'mmm':
select * from mmm;
Output:
+-------+-------+------+
| texto | value | n |
+-------+-------+------+
| aaa | 10 | 1 |
| aab | 10 | 1 |
| aaa | 11 | 1 |
| aab | 11 | 1 |
| aaa | 10 | 2 |
+-------+-------+------+
The command:
select a.*, '--', b.*
from mmm a
left join mmm b on (a.n=b.n)
where a.value < b.value
and a.texto ='aaa'
and b.texto='aab';
returns:
+-------+-------+------+----+-------+-------+------+
| texto | value | n | -- | texto | value | n |
+-------+-------+------+----+-------+-------+------+
| aaa | 10 | 1 | -- | aab | 11 | 1 |
+-------+-------+------+----+-------+-------+------+
That's fine. But what I want is something like:
+-------+-------+------+----+-------+-------+------+
| texto | value | n | -- | texto | value | n |
+-------+-------+------+----+-------+-------+------+
| aaa | 10 | 1 | -- | aab | 11 | 1 |
+-------+-------+------+----+-------+-------+------+
| aaa | 10 | 2 | -- | NULL | NULL | NULL |
+-------+-------+------+----+-------+-------+------+
or: