oracle的max()、full join和declare
发布时间:2020-12-12 14:32:02 所属栏目:百科 来源:网络整理
导读:这是近期的一些小心得,它们之间没啥关系,统一做个记录而已。 一、max() select * from table where ... 假如过滤条件不满足的话,返回的记录数为0. 但是,如果是 select max( ... ) from table where ... 过滤条件不满足,照样返回一条记录,max(…) is nu
这是近期的一些小心得,它们之间没啥关系,统一做个记录而已。 一、max() select * from table where ...
假如过滤条件不满足的话,返回的记录数为0. select max(...) from table where ...
过滤条件不满足,照样返回一条记录,max(…) is null insert into table1(...) select max(...) from table2 where ...
必有记录插入, 解决办法是再select 多一次,将max(…)作为过滤条件,is null则过滤掉。 二、full join 三、declare declare
new_time date := null;
begin while new_time is null loop pro_hy_data_handle_record;
select max(create_time) into new_time from hy_data_handle_record where create_time>to_date('2017/8/28 13:48:33','yyyy/MM/dd hh24:mi:ss');
end loop;
end; (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |