gpt4 book ai didi

sql - 返回非限定列名的 SELECT 语句

转载 作者:行者123 更新时间:2023-11-29 14:07:30 25 4
gpt4 key购买 nike

我在管理这样的查询时遇到困难:

SELECT c.id, p.id FROM claim c, procedure p LIMIT 1;

此查询将返回以下集合:

 id | id
----+----
49 | 1

有什么方法可以让它为列名返回c.idp.id 吗?这个不行:

SELECT c.id as c.id, p.id as c.id FROM claim c, procedure p LIMIT 1;

或者这是我的最终解决方案?

SELECT c.id as c_id, p.id as p_id FROM claim c, procedure p LIMIT 1;

最佳答案

SELECT c.id AS "c.id", p.id AS "p.id" FROM claim c, procedure p LIMIT 1;

或者简单地说:

SELECT c.id "c.id", p.id "p.id" FROM claim c, procedure p LIMIT 1;

关于sql - 返回非限定列名的 SELECT 语句,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18803498/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com