操作:
如果字符串只有开头有零,而字符串中间没有0,那么可以使用replace(字符串,'0','')
如果0开头最长的位数不长,那么可以逐个判断.
其实我觉得这种情况做个试验最好了,自己建个分区表,然后把每个分区建的小一点,分别插入数据看哪个分区的数据比较大就可以了 .
create table temp1
(month1 integer,
PARTITION BY LIST ("MONTH1")
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
);
insert into temp1
commit;
declare i integer;
begin
loop
insert into temp1 select * from temp1;
end loop;
end;
select t.bytes,t.partition_name from dba_segments t where t.SEGMENT_NAME='TEMP1';
结果应该是
给你做个试验你就知道了
create?table?test
执行第一遍:
此时结果:
执行第二遍:
select id
from (select id,decode(id,0,0,1) as flag from table_name) t
order by flag desc,id
;
这样id=0的部分就会排在最下面
我写一份,你试试,看看能不能通过一个SQL就能完成
select t.employee_id employee_id,
t.department_id department_id,
min(t.start_date) date,
min(t.start_date) start_date,
max(t.end_date) end_date,
from table_name t
group by employee_id,
department_id,
position
以上就是土嘎嘎小编为大家整理的oracle如何去除0相关主题介绍,如果您觉得小编更新的文章只要能对粉丝们有用,就是我们最大的鼓励和动力,不要忘记讲本站分享给您身边的朋友哦!!