问题标签 [sql-returning]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
sql - 是否有与 Oracle 的 RETURNING 语句等效的 SQL Server?
是否有与 Oracle 的 RETURNING 语句等效的 SQL Server?
我想知道OUTPUT子句是否有帮助。
sql - PL/SQL 如何返回 ROW 中的所有属性
我不知道如何使用 RETURNING 子句返回所有属性
我想要这样的东西:
RETURNING * INTO
报错,如何更换*
?
function - 在执行 INSERT INTO RETURNING 时,在规则中的函数的 postgresql 返回结果
我有一个包含多个字段的视图。
当我INSERT INTO
查看视图时,我运行基于INSERT
参数的函数。该函数返回一个值。
如何从规则中检索值?
INSERT RETURNING
给我:
错误:无法对关系“full_subntes”执行 INSERT RETURNING
提示:您需要一个带有 RETURNING 子句的无条件 ON INSERT DO INSTEAD 规则。
例子:
然后我收到上述错误。
sql - 使用 RETURNING 子句的变量赋值
我尝试这样做,但这是一个语法错误,我做错了什么?
我的桌子:
postgresql - Is it possible to get DISTINCT rows from RETURNING clause?
We're using PostgreSQL v8.2.3.
Is it possible to get DISTINCT rows from an UPDATE statement using RETURNING clause?
MYTABLE columns are:
- APRIMARYKEYCOLUMN
- ABOOLEANCOLUMN
- COLUMN1
- COLUMN2
- COLUMN3
UPDATE using RETURNING clause query:
Here in this case, I expect to return distinct rows from these columns: EMAIL, COLUMN1, COLUMN2, COLUMN3.
I even tried out some ways of getting distinct rows, but it doesn't work. Though I can still solve this at application layer, I'm trying to find whether this could be solved/controlled at query-level. Any different ideas/suggestions are appreciated.
postgresql - INSERT RETURNING 是否保证以“正确”的顺序退货?
例子:
回报:
似乎返回值中的第一个总是for ,第二个 for等等,但这是定义的行为,还是在奇怪的情况下可能会失败的巧合? id
id
'a'
'b'
insert into
postgresql - 我可以在另一个 INSERT 中使用 INSERT...RETURNING 的返回值吗?
这样的事情可能吗?
就像使用返回值作为值在第二个表中插入一行并引用第一个表?
python - postgreSQL pl/python 如何从查询中获取返回?
在这个(非常简洁的)查询中,如何从 RETURNING 返回 myfile_key?
(插入的第一个字段是 myfile_key)
该代码不会将值返回到输出,并且无法将其作为标准 python 结果进行查询,如下所示:
sql - 高效地复制 PostgreSQL 表中的一些行
我有使用自动递增整数作为主键的 PostgreSQL 9 数据库。我想复制表中的一些行(基于一些过滤条件),同时更改一个或两个值,即复制所有列值,除了 ID(它是自动生成的)和可能的另一列。
但是,我也想获得从旧 ID 到新 ID 的映射。有没有更好的方法来做到这一点,然后只查询要首先复制的行,然后一次插入一个新行?
基本上我想做这样的事情:
但是,这失败了ERROR: missing FROM-clause entry for table "old"
,我可以看到原因:Postgres 必须先执行 SELECT 然后插入它,并且RETURNING
子句只能访问新插入的行。
postgresql - Returning cursor results
I have the following procedure :
But I don't know how to return the result out of this procedure. The query returns 5 rows for each execution within outer cursor loop. How can I retrieve these five rows for each query execution?