符号 || 在oracle中是连接符号,可以将两个字段的值连接在一起
举例
有一组数据
create table accu ( day_code varchar2(10), buss_month varchar2(10), fnum int ) insert into accu values('20210927','202109',1); insert into accu values('20210928','202110',2); insert into accu values('20210927','202109',2); insert into accu values('20210929','202110',3); insert into accu values('20210930','202110',4); insert into accu values('20211001','202110',5);
测试连接符
select buss_month||'卖出'||sum(fnum)||'个' text from accu group by buss_month
结果