Is it possible to choose from two tables of the database using one query and sort them in alternation, that is, in the final selection the records alternate (2 out of 1.2 out of -2 and so on)?
Source: https://ru.stackoverflow.com/questions/892415/
All Articles
& 0xFFFFFFFE) (or subtracting the remainder of the division by 2). We get the numbers 0, 0, 2, 2, 4, 4, ... From the second table, the same but +1. It remains to make the union and sort by this field. But how exactly to get line numbers depends on the sql dialect. up to version 8 in MySQL will have to use variables In version 8 of MySQL and in the overwhelming majority of other DBMS, you can use the row_number () function - Mike