求关于两行数据合并为一行数据的sql语句
想要得到结果:
[最优解释]
WITH cars AS
(SELECT '1' carid,'东风' carname, '11' driveraid, '12' driverbid FROM dual),
driver AS
(SELECT '11' driverid,1 carnum,'aaa' drivername FROM dual UNION
SELECT '12' driverid,1 carnum,'bbb' drivername FROM dual )
SELECT CARID,
CARNAME,
(SELECT DRIVERNAME
[其他解释]
'('
[其他解释]
还有就是driveraid的名字drivername放在driverbid前面