sql - Postgres 函数插​​入值/参数范围

标签 sql function postgresql

我有一个 Postgres 函数……像那样:

INSERT INTO people.person (name, middlename, stat,city,tel [.....] )
VALUES ($2,$3,$4,$5,$6,$7, [.....] ,$25,$26,$27,$28,$29,$30,$31)

有没有办法,我可以用……比如 VALUES ($2-$31)?在这里找不到任何东西:http://www.postgresql.org/docs/8.2/static/sql-insert.html .

最佳答案

我使用了矛盾的解决方案,对我来说效果很好:

'..VALUES ($' + join([2..31], ',$') + ')'

关于sql - Postgres 函数插​​入值/参数范围,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19095941/

相关文章:

python - 为什么我会收到带有 sqlalchemy 元数据的现有表的 "relation does not exist"错误?

postgresql - 如何从 php 获取 postgres 约束检查的允许值列表

postgresql - Airflow "Something Bad Has Happened"错误 : Session Table does not exist

sql - 为什么在使用数据库邮件时出现以下错误 -> 过程 sysmail_verify_profile_sp,配置文件名称无效?

java - 模式更新后 jOOQ 生成类的运行时验证?

javascript - 使用 .reduce() 对数字进行因式分解

Javascript 函数抛出错误

c - 查找字符串中的公共(public)字符

1天内多笔交易的SQL ID

mysql - 根据另一个表中设置的条件更新数据库表?