标签: mysql select
如何合并查询?
SET @i = 0;
和
SELECT (@i:=@i+1) as i, booking.* from booking;
没有“CREATE PROCEDURE”和“CREATE INDEX”有什么办法吗?
答案 0 :(得分:0)
在设置变量的查询上进行交叉连接:
SELECT (@i:=@i+1) as i, booking.* FROM booking CROSS JOIN (select @i := 0) x;