问题描述
嗨,
我在存储过程中有一个选择进入查询,它在where子句中使用列group_id。但是它没有过滤数据,因为列名与oracle函数名称group_id相同。我无法更改列名。如何在plsql where子句中使用
将lmt_id选择为l_lmt_id
从表1 t
其中t.group_id = p_grp_id;
我在存储过程中有一个选择进入查询,它在where子句中使用列group_id。但是它没有过滤数据,因为列名与oracle函数名称group_id相同。我无法更改列名。如何在plsql where子句中使用
将lmt_id选择为l_lmt_id
从表1 t
其中t.group_id = p_grp_id;
专家解答
我想你需要详细说明
SQL> create table table1 ( lmt_id int, group_id int ); Table created. SQL> insert into table1 values (1,1); 1 row created. SQL> SQL> declare 2 l_lmt_id int; 3 p_grp_id int := 1; 4 begin 5 Select lmt_id into l_lmt_id 6 from table1 t 7 where t.group_id = p_grp_id; 8 end; 9 / PL/SQL procedure successfully completed.
文章转载自ASKTOM,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。




