Correction sql to CSV