Hi,

I need some help with a tricky query.  Before anyone asks, I cannot bring
this functionality back to the application layer (as much as I'd like to).

Here's what I need to do...

create table wibble(
seq int(3) auto_increment primary key,
x int(5),
y int(5)
);

insert into wibble set x=5, y=10;
insert into wibble set x=1, y=3;
insert into wibble set x=17, y=22;

mysql> select * from wibble;
+-----+------+------+
| seq | x    | y    |
+-----+------+------+
|   1 |    5 |   10 |
|   2 |    1 |    3 |
|   3 |   17 |   22 |
+-----+------+------+
3 rows in set (0.09 sec)

So I want to run a query to explode the x/y ranges by seq.

The required output is:

mysql> select some clever things from wibble where some clever stuff happens
here;
+-----+------+
| seq | z    |
+-----+------+
|   1 |    1 |
|   1 |    2 |
|   1 |    3 |
|   1 |    4 |
|   1 |    5 |
|   2 |    1 |
|   2 |    2 |
|   2 |    3 |
|   3 |   17 |
|   3 |   18 |
|   3 |   19 |
|   3 |   20 |
|   3 |   21 |
|   3 |   22 |
+-----+------+
14 rows in set (0.17 sec)

Can anyone help me to achieve this result?

Thanks,

Andrew

SQL, Query




-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to