就只有两行??? select min(prodname)||'和'||max(prodname) prodname, mim(province)||'和'||max(province) province from a
select substr(max(sys_connect_by_path(PRODNAME, '和')), 2) PRODNAME, substr(max(sys_connect_by_path(PROVINCE, '和')), 2) PROVINCE from ( select PRODNAME, PROVINCE, rownum n1 from a) start with n1=1 connect by n1=rownum
select (select prodname from a where prodname =a1)||'和' (select prodname from a where prodname =a2)||'和' (select prodname from a where prodname =a3)||'和' .... (select prodname from a where prodname =an') prodname, (select province from a where prodname =a1)||'和' (select province from a where prodname =a2)||'和' (select province from a where prodname =a3)||'和' .... (select province from a where prodname =an')province from dual;
select min(prodname)||'和'||max(prodname) prodname,
mim(province)||'和'||max(province) province
from a
substr(max(sys_connect_by_path(PROVINCE, '和')), 2) PROVINCE from (
select PRODNAME, PROVINCE, rownum n1 from a)
start with n1=1
connect by n1=rownum
(select prodname from a where prodname =a1)||'和'
(select prodname from a where prodname =a2)||'和'
(select prodname from a where prodname =a3)||'和'
....
(select prodname from a where prodname =an') prodname,
(select province from a where prodname =a1)||'和'
(select province from a where prodname =a2)||'和'
(select province from a where prodname =a3)||'和'
....
(select province from a where prodname =an')province
from dual;