non, PIVOT c'est du 11g
Code :
CREATE TABLE t AS (
SELECT 'Renault' marque, 'Clio' model FROM dual union ALL
SELECT 'Renault', 'Twingo' FROM dual union ALL
SELECT 'Renault', '5' FROM dual union ALL
SELECT 'Peugeot','106' FROM dual union ALL
SELECT 'Peugeot','205' FROM dual union ALL
SELECT 'Peugeot','607' FROM dual );Code :
SELECT
marque,
max(decode(r,1,model)) model1,
max(decode(r,2,model)) model2,
max(decode(r,3,model)) model3
FROM (
SELECT
marque,
model,
row_number() over (partition BY marque ORDER BY model) r
FROM t)
GROUP BY marque;
Code :
MARQUE MODEL1 MODEL2 MODEL3
------- ------ ------ ------
Peugeot 106 205 607
Renault 5 Clio Twingo
Partager