Created
February 4, 2013 21:30
-
-
Save coffindragger/4709888 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select "originalid","user","date","start","duration","project","activity","ticket","note" | |
union all | |
select | |
concat(u_id,'--',al_timestamp) as "originalid", | |
u_login, | |
al_date as "date", | |
al_from as "start", | |
al_duration as "duration", | |
p_name as "project", | |
a_name as "activity", | |
al_ticket as "ticket", | |
al_comment as "note" | |
FROM activity_log | |
JOIN projects on al_project_id=p_id | |
JOIN activities on al_activity_id=a_id | |
JOIN users on al_user_id=u_id | |
INTO OUTFILE '/tmp/timetracker-entries.csv' | |
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' | |
LINES TERMINATED BY '\n' | |
; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment