order by rscount desc) from (
select create_date, distinct count(*) as rscount
from aj_t_ac_project rx
group by rx.create_date
order by create_date) vx
insert first
when noon > 80 then
into comfort_test(city,sampledate,measure,value)
values(city,sampledate,'noon',noon)
when midnight > 100 then
into comfort_test(city,sampledate,measure,value)
values(city,sampledate,'midnight',midnight)
when precipitation>100 then
into comfort_test(city,sampledate,measure,value)
values(city,sampledate,'precip',precipitation)
else
into comfort2
merge into comfort c1
using (select city,sampledate,noon,midnight,
precipitation from comfort2) c2
on(c1.city = c2.city and c1.sampledate = c2.sampledate)
when matched then
update set noon = c2.noon
when not matched then
insert (c1.city,c1.sampledate,c2.noon,
c2.midnight,c1.precipitation)
values(c1.city,c2.sampledate,c2.noon,
c2.midnight,c2.precipitation);
//创建虚拟列
create table author2(
authorname varchar2(50) primary key,
comments varchar2(100),
mixedname varchar2(50),
generated always as(
initcap(authorname)) virtural
);
如果一个视图基于单个底层的表,那么可以在此视图中对行进行insert、update或delete操作.这实际将在底层的表中insert、update或delete行.
这样做存在一些限制,不过这些限制很合理:
(1)如果底层的表具有未出现在视图中的任意not null列,则不能进行insert操作.
(2)如果在insert或update中引用的任意一个视图的列包含了函数或计算,则不能进行insert或update操作
(3)如果视图包括group by、distinct或对伪列rownum的引用,则不能进行insert、update或delete操作
如果oracle能确定要插入的适当的行,那么可以在基于多个表的视图上进行insert操作.
在一个多表视图中,oracle可以确定那些表是被键保留的.如果一个视图包含了标识该表的主键的足够多的列,则这个键被保留,
并且oracle可以通过此视图向表中插入行.
大字段clob需要插入<p>oracle</p>样式字段 需要使用
rawtohex('<p>oracle</p>');