I am trying to build a SQL statement that selects 4 columns from a table but only saves one of them.
... UNION SELECT field1,field2,field3 INTO OUTFILE '/path' FROM table WHERE condition
The result is
field1,field2,field3
However I only want to save field3.
field3
I have tried:
... UNION SELECT NULL,NULL,field3 INTO OUTFILE '/path' FROM table WHERE condition
But it results on the follwing:
\n \n field3
I cannot remove the field1 and field2 because the SQL statement is to be concatenated with other SQL statements.
Thank you for your help
Note : I am using MySQL