1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
|
Connected to Oracle Database 10g Enterprise Edition Release 10.2.0.4.0
Connected as mni
SQL>
SQL> With Data As (
2 Select 'Chai' as txt from dual union all
3 Select 'Aniseed Syrup.Condiments' from dual union all
4 Select 'Queso Manchego La Pastora.Pâtes et céréales.Alimentations' from dual
5 )
6 Select Substr(txt||'.',1,Instr(txt||'.','.',1,1)-1) as categorie,
7 Substr(txt||'.',Instr(txt||'.','.',1,2-1)+1,
8 Instr(txt||'.','.',1,2)-Instr(txt||'.','.',1,2-1)-1) as sous_categorie,
9 Substr(txt||'.',Instr(txt||'.','.',1,3-1)+1,
10 Instr(txt||'.','.',1,3)-Instr(txt||'.','.',1,3-1)-1) as Autre
11 From Data
12 /
CATEGORIE SOUS_CATEGORIE AUTRE
---------------------------------------------------------- ---------------------------------------------------------- ----------------------------------------------------------
Chai
Aniseed Syrup Condiments
Queso Manchego La Pastora Pâtes et céréales Alimentations
SQL> |
Partager