oracle数据拼成一条

oracle查出的数据展示为一条
现在有个表 查出来的数据是最后两个字段不一致,其他字段都一致,且是一个表中
nameidtitletype
x1开始标题a
x1中标题b
x1结束标题c
我想要达到的结果

筛选出 a 和 c的拼成一条数据

nameidBtitleEtitle
x1开始标题结束标题

不知道sql应该如何写 用到什么函数

select a.name,a.id,a.title btitle,b.title etitle from 表 a left join 表 b on a.id=b.id and a.type='a' and c.type='c'

楼上的其实是对这个表分别查两次,一次取A,一次取C,然后join,当然只有一行。
一般情况下,这种需求常见的写法是这个样子的

select name,id,
max(case when type='A' then title end) BTITLE,
max(case when type='C' then title end) ETITLE
fromwhere type in ('A','C')
group by name,id

如果是oracle,更舒服的写法应该是

select * from 表 pivot (max(title) for type in ('A' BTITLE,'C' ETITLE))