Created
July 9, 2015 00:38
-
-
Save dstreefkerk/0b2e9329b845f31bd7e1 to your computer and use it in GitHub Desktop.
SQLite query to extract users from Spiceworks' DB for tickets created in the past 2 years and get it into the format required by FreshDesk for contact import via CSV
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 distinct u.email as email, | |
u.first_name || ' ' || u.last_name as name, | |
u.title as job_title, | |
u.cell_phone as mobile, | |
u.office_phone as phone, | |
u.location as time_zone, | |
'en' as language | |
from users as u | |
inner join tickets as t on u.id = t.created_by | |
where (u.disabled is null) and ((u.first_name is not null) and (u.last_name is not null)) | |
and (t.created_at > date('now','-2 years')) | |
order by u.last_name |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment