Hubert Kubasiewicz
Hubert Kubasiewicz

Reputation: 375

How to export selected data from mysql base but not via phpmyadmin but with a click

I have created a database of my clients. Each client has got an email address and the date when I added the record. When I put in a search box eg 2015-12-10 I can see all the entries of this day filtered so I can see all the companies I added that day, BUT I would like to export only emails to cvs or excel but without using phpmyadmin just with a "click". I would be grateful for the hints. Thank You Hubert

Upvotes: 0

Views: 39

Answers (1)

user3162020
user3162020

Reputation: 52

For one click...you could simply execute code like this which would be one press of the execute button:

SELECT emails
INTO OUTFILE '/tmp/emails.csv'
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
LINES TERMINATED BY '\n'
FROM mydatabase
WHERE date = '2015-12-10'
;

Or, for two clicks...

With MySQL workbench, DB Forge, and other MySQL database frontends you can export to Excel very easily (but with two clicks...first the export button, then save). You simply need to write your select statement first.

Or, with a few more clicks...

You could use an MS Access frontend and create a linked table to your MySQL database. In Access you could have saved queries with parameters, where, once opened you could then export to Excel...but again, may be more than one click to achieve this.

Upvotes: 1

Related Questions