select into赋值方式

declare
  v_price number(10,2);--单价
  v_usenum number;--水费字数
  v_usenum2 number;--使用吨数
begin
  v_price:=2.45;--每吨单价
 -- v_usenum := 10000000;
 select usenum into v_usenum from t_account t where t.id=1 and t.year='2012' and t.month='01';
  v_usenum2 := round(v_usenum/1000,2);
  DBMS_OUTPUT.put_line('字数为:'||v_usenum||'金额为:'||(v_price*v_usenum2));
end;

原文地址:https://www.cnblogs.com/niwotaxuexiba/p/9743672.html