1.
SELECT t.*,
@curRow := @curRow + 1 AS row_number
FROM structure t
JOIN (SELECT @curRow := 0) r;
2.
set @x=0;
SELECT
@x :=ifnull(@x,0)+1 AS rownum ,order_sn
FROM
order_item;
时间: 2024-11-05 22:38:29
1.
SELECT t.*,
@curRow := @curRow + 1 AS row_number
FROM structure t
JOIN (SELECT @curRow := 0) r;
2.
set @x=0;
SELECT
@x :=ifnull(@x,0)+1 AS rownum ,order_sn
FROM
order_item;