user3244104
user3244104

Reputation: 111

export query result as csv file with inner join in mysql

Unable to query result as csv from mysql using GUI when I click on export it jump to query window

Using below query

select a.product_id,a.model,b.name 
from oc_product a inner join oc_product_description b on
a.product_id=b.product_id where a.status=1

I'm getting result to display but unable to export same as CSV file

Upvotes: 2

Views: 5069

Answers (2)

Marcin Żurek
Marcin Żurek

Reputation: 151

You can simply make query in SQL tab, then press show all, then copy whole table contains columns and paste it to Excel or Open Office. Then You can save it as csv or any other file.

Upvotes: 0

Sunit
Sunit

Reputation: 382

select a.product_id,a.model,b.name from oc_product a inner join oc_product_description b on a.product_id=b.product_id where a.status=1 INTO OUTFILE '/tmp/product.csv' FIELDS TERMINATED BY ',' ENCLOSED BY '"' LINES TERMINATED BY '\n';

you can export directly from sql.

Upvotes: 3

Related Questions