在某些特定条件下,从数据库中查寻List数据的时候,需要给每组数据带上一个key序号。具体实现代码如下:
SELECT
(@i:= @i+1) as 'key',
c.country_name as countryName,
c.country_code as countryCode
FROM
country c,
(SELECT @i:=0) as i
在某些特定条件下,从数据库中查寻List数据的时候,需要给每组数据带上一个key序号。具体实现代码如下:
SELECT
(@i:= @i+1) as 'key',
c.country_name as countryName,
c.country_code as countryCode
FROM
country c,
(SELECT @i:=0) as i