Skip to content

Instantly share code, notes, and snippets.

@mikebuchanon
Created July 4, 2013 15:55
Show Gist options
  • Save mikebuchanon/5928787 to your computer and use it in GitHub Desktop.
Save mikebuchanon/5928787 to your computer and use it in GitHub Desktop.
Another example of using SQL Variables in the ANGEL SQL Query Manager
SQLVAR: $course_id$ = [?Enter the Course ID in question]
SQLVAR: $login_name$ = [?Enter the loginname of the student in question]
SQLVAR: $filter$ = [?Enter a filter %quiz 02%, %02%, etc or % for all]
select ll.course_id, a.loginname, lo.TITLE, lo.OBJECT_TYPE, ll.access_date
from LSN_LOGS ll (nolock)
join LSN_OBJECTS lo (nolock) on lo.OBJECT_ID=ll.OBJECT_ID
join ACCOUNTS a on ll.USER_ID=a.USERNAME
where ll.COURSE_ID = $course_id$
and a.LoginName = $login_name$
and lo.TITLE like $filter$
order by ll.ACCESS_DATE asc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment