我正在尝试使用Anorm(Postgres)编写此sql查询:
SELECT * FROM employee WHERE id = 1
AND length(ee_json #>> '{path1,paht2}') BETWEEN 0 and 1;
它应该是这样的:
SQL(
s"""
|SELECT id FROM employee WHERE id = {id}
|AND length(ee_json #>> {param} ) BETWEEN {min} and {max}
""".stripMargin)
.on('id -> id,
'min -> min,
'max -> max,
'param -> "'{path1,path2}'")
.as(parser.*)
但是当我运行它时我得到ArrayIndexOutOfBoundsException
。