I've written a query and have filtered out the E.G "Salaries over $120,000."
I want to redirect the answer to a .csv file, however Im experiencing issues.
Ive read online that : To redirect the output of your queries to a file, append the following
clause to your queries:
INTO OUTFILE <filename> FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'
However: when I append this to my query...
SELECT from_date FROM dept_emp_latest_date WHERE from_date < '2002-08-01' and from_date > '2002-07-01' INTO OUTFILE new_hires.csv FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
I just get a syntax error.
The query below works fine. But I need help to redirect it to my file... new_hires.csv.
SELECT from_date FROM dept_emp_latest_date WHERE from_date < '2002-08-01' and from_date > '2002-07-01'