There is a sample:
SELECT issues.id, issues.priority_id, issues.project_id, issues.subject, c.value, t.tag_id from issues INNER JOIN taggings t ON issues.id = t.taggable_id and t.tag_id = 623 INNER JOIN custom_values c ON c.customized_id = issues.id and c.custom_field_id = 105 WHERE issues.priority_id = 4 and issues.project_id = 66 and issues.status_id NOT IN ( 5, 6, 11, 9) ORDER BY issues.id As a result, the following data is output:
How to make so that each record in this sample in the value field is substituted with a number, in order from 1 to the number of rows in the sample? Those. for example, the first entry with id = 59517 in the value field is set to 1, the second entry with id = 72821 in the value field is set to 2, etc., those are in increasing id, respectively, the value field is numbered in order from 1 to 31 ( as in this case).
