I have the following query in MySQL
, with which I get the posts associated with the users who created them
SELECT users.nameUser, posts.namePost
FROM users
JOIN posts ON users.id = posts.user_id;
However, I need to work directly from the console and at the time I execute this query I need to export the result of it to an external file in .csv
format; I know there are visual environments like Heidi or Workbench to do that task quickly but I need to work from the console;
How do I get to do this task?