0

I'm trying to unload data from Mysql and know of the SELECT ... INTO OUTFILE but that requires extra permissions for my user. While I wait for those perms, I was wondering if there's a setting I can add to a general select clause to enclose fields within a character like a double quotation ". I figure this would work, but it requires a lot of editing and I have hundreds of fields to apply this to...

SELECT
 concat('"' , field1, '"'),
 concat('"' , field2, '"')
from 
 mytable
simplycoding
  • 2,770
  • 9
  • 46
  • 91
  • maybe export to csv https://stackoverflow.com/questions/22783202/exporting-mysql-table-into-a-csv-file – splash58 Jan 30 '18 at 20:11
  • Just pop your list of fields into excel and then do `="concat('" & char(34) & "' , " & A1 & ", '" & char(34) & "'),"` and copy the formula down, then copy paste the list into your sql client. – JNevill Jan 30 '18 at 20:52

0 Answers0