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 26 27 28 29 30 31 32
| select col1,
col2,
col3,
col4
from ( select '1' as rang,
'id' as col1,
'annee_academique' as col2,
'id_option' as col3,
'id_bloc' as col4
union
select '2' as rang,
t1.id as col1,
t1.annee_academique as col2,
t2.id as col3,
t1.id_bloc as col4
from maTable as t1
inner join option as t2
on t2.xx = t1.xx
order by rang, col2, col3, col4
) as x
into outfile '$filename'
character set latin1
field terminated by ';'
optionally enclosed by '\"'
escaped by '\\'
line terminted by '\r\n'; |
Partager