I have the following SQL command that I need to save as a csv file with column headers:
mysql > SELECT a.last_name, a.first_name, username, is_active, graduation
FROM auth_user a
INNER JOIN
userprofile_userprofile u
ON a.id = u.user_id
WHERE a.id>39 AND a.is_active=1 ORDER BY last_name
How would I do this?