sql to export to csv added