我想知道是否可以为查询结果分配临时/虚拟ID?
例如,我将此作为我的查询,
SELECT
pg_id AS ID,
pg_url AS URL,
pg_title AS Title,
pg_content_1 AS Content
FROM root_pages
ORDER BY pg_created DESC
输出:
ID URL Title Content
53 a A xxx
40 b B xxx
35 c C xxx
你可以看到ID之间的差距 - 它们非常不整洁。我想知道我是否可以创建一个虚拟列或其他东西,以便我有下面的输出,
ID URL Title Content Virtual ID
53 a A xxx 3
40 b B xxx 2
35 c C xxx 1
来自下面的查询,
SELECT
pg_id AS ID,
pg_url AS URL,
pg_title AS Title,
pg_content_1 AS Content
FROM root_pages
ORDER BY virtual_id DESC
有可能??
谢谢!