This code runs on MYSQL can export CSV,
I'm on the BAT, cannot export:
CD C: \ Program Files (x86)/MySQL/MySQL Server 5.0 \ bin
"C: \ Program Files (x86)/MySQL/MySQL Server 5.0 \ bin \ MySQL" - uroot - ppassword blank - N - e "Select b.b arcode as barcode, sum (b.q ty) as qty into outfile 'D:/backup/1. CSV FIELDS TERMINATED BY', 'OPTIONALLY ENCLOSED BY'" "' LINES TERMINATED BY '\ N' From trans a join transdetail b on a.t ransid=b.t ransid where a. usinessdate=date_add (curdate (), the interval of 1 day) and a.t ransstatus=2 and b.i temstatus<> 1 group by b.b arcode
"
CodePudding user response:
Know, ENCLOSED BY '" "' to ENCLOSED BY"CodePudding user response:
ENCLOSED BY '" "' to ENCLOSED BY ' 'CodePudding user response:
Without the output file, command to join & gt;> Test. The CSV