MySQL

MySQL Export Data to CSV File using SQL

SELECT pics.pic_id,pics.pic_pic,pics.pic_th,pics.pic_full,pics.pic_text,pics.pic_date,pics.pic_order,pics.pic_zoom,pics.pic_views,galleries.gal_title,galleries.gal_folder FROM photocart.pics LEFT JOIN photocart.galleries ON pics.pic_gal=galleries.gal_id WHERE TRIM(COALESCE(pics.pic_full,'')) !='' INTO OUTFILE 'c:/temp/photos.csv' FIELDS TERMINATED BY ',' ENCLOSED BY '"' LINES TERMINATED BY '\n'

%d bloggers like this: