If i have a table that looks like
num
1
2
3
4
5
6
7
8
9
And i want to display the same table in two columns
SELECT t1.num, t2.num FROM (SELECT * FROM x) AS t1, (SELECT * FROM x) AS t2
So the result set looks like
num
1,1
2,2
3,3
4,4
5,5
6,6
7,7
8,8
9,9
How would i go about doing this in MySQL
EDIT
Sorry i didnt want to make things complex to start with: But here is what im actually trying to do
To clarify a little more, What im actually trying to do is
num
1,2
2,3
3,4
4,5
5,6
6,7
7,8
8,9
what i want to be able to do further:
SELECT t2.num - t1.num FROM ....
Note that the above query will return all 1s but the values in my database are different to what are displayed above
Thanks in Advance