oracle 形式:pl/sql 中 where 子句内的 max 子句
oracle forms: max clause inside a where clause in pl/sql
select balance from newrecord where s_no in(select max(s_no) from
newrecord) into :summary.Bal ;
如何将其从 sql 转换为 pl/sql?
说明:从table newrecord中选择一个余额,其中s_no(序列号)newrecord的一个成员是最大的所以假设它从1到6开始会选择显示余额s_no = 6 , :summary.Bal 是一个显示余额的文本项
使用正确的语法:
select <field_name> into <variable_name> from <rest of query>
此外,您的查询中不需要 IN 运算符,只需编写 =
... where s_no = (select max(s_no) from newrecord)
select balance from newrecord where s_no in(select max(s_no) from newrecord) into :summary.Bal ;
如何将其从 sql 转换为 pl/sql?
说明:从table newrecord中选择一个余额,其中s_no(序列号)newrecord的一个成员是最大的所以假设它从1到6开始会选择显示余额s_no = 6 , :summary.Bal 是一个显示余额的文本项
使用正确的语法:
select <field_name> into <variable_name> from <rest of query>
此外,您的查询中不需要 IN 运算符,只需编写 =
... where s_no = (select max(s_no) from newrecord)