sql语句里能不能使用自己定义的变量吗?为什么呀? 你可以这样来实现select * from mytablewhere trunc(mydate)=trunc(sysdate)-&i这样在执行时会提示让你输入变量的值,然后再执行 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 如果你是用pl/sql dev工具测试的话,可以这么写:select * from .......where ...-&i这样系统会要求输入一个值.如果写在pl/sql块中:... i number(8);begin i=7; selet ...into ...from ....where ...-i; ...end; 可以用&来select &s1from &f1,&f2where &w1; 可以设变量的。没有问题!但是你定义变量的方式不对,不满足sql语法。declare i integeri :=7select * from mytablewhere trunc(mydate)=trunc(sysdate)-i 如果你是用pl/sql dev工具测试的话,可以这么写:select * from .......where ...-&i这样系统会要求输入一个值.要不然你就写一个存储过程,调用存储过程就可以 oracle中clob的问题 sqlldr 插入到多表的问题 高分提问. 一张表有200多万行数据,现在要更新其中一列数据,超慢,怎么提高更新速度? 在jdbc中怎么使用oracle的long类型。 具有sysdba权限的用户sys登陆oracle817时为何无法用sysdba连接? 紧急求助:多表关联查询的sql构造 求一条sql语句 如何实现不确定列的交叉表 如何修改oracle默认的通配符??? 数据库每日更新,应如何用SELECT语句提取前第七天那一天的数据? 数据库无法恢复问题,急急急
select * from .......where ...-&i
这样系统会要求输入一个值.如果写在pl/sql块中:
...
i number(8);
begin
i=7;
selet ...into ...from ....where ...-i; ...
end;
from &f1,&f2
where &w1;
但是你定义变量的方式不对,不满足sql语法。declare i integer
i :=7select * from mytable
where trunc(mydate)=trunc(sysdate)-i
select * from .......where ...-&i
这样系统会要求输入一个值.要不然你就写一个存储过程,调用存储过程就可以