Home > Database > Mysql Tutorial > 数据库合并重复记录

数据库合并重复记录

WBOY
Release: 2016-06-07 14:53:38
Original
1565 people have browsed it

数据库合并重复记录 create or replace function str_list( str_in in varchar2 ) --分类字段 return varchar2 is str_list varchar2(4000) default null; --连接后字符串 str varchar2(20) default null; www.2cto.com --连接符号 begin for x in ( select


数据库合并重复记录

 

create or replace function str_list( str_in in varchar2 ) 

--分类字段 

return varchar2 is 

str_list  varchar2(4000) default null; 

--连接后字符串 

str  varchar2(20) default null; 

  www.2cto.com  

--连接符号 

begin 

for x in ( select TEST.CITY from TEST 

where TEST.COUNTRY = str_in ) loop 

str_list := str_list || str || to_char(x.city); 

str := ','; 

end loop; 

return str_list; 

end; 

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template