Exporting results of a Mysql query to excel?

后端 未结 5 1557
有刺的猬
有刺的猬 2020-11-29 00:36

My requirement is to store the entire results of the query

SELECT * FROM document 
WHERE documentid IN (SELECT * FROM TaskResult WHERE taskResult = 2429)
         


        
5条回答
  •  生来不讨喜
    2020-11-29 01:08

    Good Example can be when incase of writing it after the end of your query if you have joins or where close :

     select 'idPago','fecha','lead','idAlumno','idTipoPago','idGpo'
     union all
    (select id_control_pagos, fecha, lead, id_alumno, id_concepto_pago, id_Gpo,id_Taller,
    id_docente, Pagoimporte, NoFactura, FacturaImporte, Mensualidad_No, FormaPago,
    Observaciones from control_pagos
    into outfile 'c:\\data.csv' 
    FIELDS TERMINATED BY ',' 
    OPTIONALLY ENCLOSED BY '"'
    LINES TERMINATED BY '\n');
    

提交回复
热议问题