select (CASE WHEN ( t1.PRICE is null ) then v.Selling2 else t1.PRICE end) as "PRICE"
from AGENTGOODSCHECK t1 left join V_AGENTGOODSMASTER v
on t1.GOODSCODE=v.OrderCode
where CONVERT (VARCHAR(10),DATEADD(DAY,-1,t1.VDATE),111) = '2011/11/24'
and t1.GOODSCODE='000809'
and t1.STATUS<>'03'
可以多个嵌套,但是只要一个条件不满足结果都查询不到,你把语句写出来看下Update Table Set a='5' Where b=
(Select b
From Table
Where c In (Select c
From Dmpedi.Pps_Temp
Where b = '2'
And Rownum <5)
And Rownum = 1)
一plsql程序简介plsql就是对sql程序的扩展,使我们更好的在Oracle数据库上 *** 作数据
1.plsql的程序结构
plsql的程序结构分为四部分:
declare
声明部分(变量的声明,光标的申明,异常说明);
begin
plsql执行语句
exception
异常处理语句
end;
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)