我有一个 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/