I have a select query
select id from tags
Which returns data like
id
--
1
2
I want to get data with a sequence number as shown below
id seq
-- ---
1 1
1 2
1 3
1 4
1 5
2 1
2 2
2 3
2 4
2 5
How can I achieve this in mysql
I have a select query
select id from tags
Which returns data like
id
--
1
2
I want to get data with a sequence number as shown below
id seq
-- ---
1 1
1 2
1 3
1 4
1 5
2 1
2 2
2 3
2 4
2 5
How can I achieve this in mysql
2
Answers
Or
You can use an incremental variable as specified here;
In your case, the query should be like this: