1 a
2 就
3 是
4 嗯
5 cc
6 dd
拼接结果为:
a,就,是,嗯,cc,dd
用逗号拼接起来
7 个解决方案
#1
找到了一条,想看看有没有更简单的。。。
剪短的sql语句。。
剪短的sql语句。。
#2
#3
select wmsys.wm_concat(name) from table_name
#4
with t as (
select 1 as ismaster,'qingyun' as uname,'租赁' as state from dual union all
select 0 as ismaster,'aa' as uname,'租赁' as staet from dual union all
select 0 as ismaster,'aa' as uname,'空闲' as staet from dual
)
select wmsys.wm_concat(uname) from (select * from t where state='租赁' order by ismaster desc)
#5
wmsys.wm_concat()拼接字段 以逗号分开
#6
WITH t AS(
SELECT 1 id,'a' NAME FROM dual
UNION ALL
SELECT 2,'就' FROM dual
UNION ALL
SELECT 2,'是' FROM dual
UNION ALL
SELECT 2,'嗯' FROM dual
UNION ALL
SELECT 2,'cc' FROM dual
UNION ALL
SELECT 2,'dd' FROM dual
)
SELECT wm_concat(name) FROM t
#7
不好意思,已经结贴了。
#1
找到了一条,想看看有没有更简单的。。。
剪短的sql语句。。
剪短的sql语句。。
#2
#3
select wmsys.wm_concat(name) from table_name
#4
with t as (
select 1 as ismaster,'qingyun' as uname,'租赁' as state from dual union all
select 0 as ismaster,'aa' as uname,'租赁' as staet from dual union all
select 0 as ismaster,'aa' as uname,'空闲' as staet from dual
)
select wmsys.wm_concat(uname) from (select * from t where state='租赁' order by ismaster desc)
#5
wmsys.wm_concat()拼接字段 以逗号分开
#6
WITH t AS(
SELECT 1 id,'a' NAME FROM dual
UNION ALL
SELECT 2,'就' FROM dual
UNION ALL
SELECT 2,'是' FROM dual
UNION ALL
SELECT 2,'嗯' FROM dual
UNION ALL
SELECT 2,'cc' FROM dual
UNION ALL
SELECT 2,'dd' FROM dual
)
SELECT wm_concat(name) FROM t
#7
不好意思,已经结贴了。