我正在尝试运行像
这样的查询select id from table where id = pseudo_encrypt(select last_value from id_seq)
...
select last_value from id_seq
返回5,这是正确的结果。我的问题是如何将其用作函数参数
故事是我将表的id存储为id_seq的加密值。
所以我需要得到id与加密的匹配的结果。
select last_value from id_seq
我想我需要写一个函数,但我不擅长Postgresql。
答案 0 :(得分:0)
我找到了解决方案。 查询必须类似于
select * from table where id = pseudo_encrypt(currval('id_seq'::regclass))
感谢您的帮助