The following code creates rows in a MYSQL table but returns them in descending order.
How can I make it return values in ascending order?
INSERT INTO
rent
(
id
)
select @s:=@s+1 as seq
FROM (SELECT @s:=399) AS baseview, rent
WHERE @s<1000;
Use an ORDER BY clause using the column that determines the order when you SELECT.
Order means nothing when you INSERT. You should not know or care about how it’s stored underneath. SQL is declarative – worry about what is done, not how.