Skip to content

Instantly share code, notes, and snippets.

@hanleybrand
Created March 31, 2015 21:32
Show Gist options
  • Save hanleybrand/bd3af96cef1b26ff2f08 to your computer and use it in GitHub Desktop.
Save hanleybrand/bd3af96cef1b26ff2f08 to your computer and use it in GitHub Desktop.
checking the select queries
use bb_bb60;
declare @COURSEID varchar(200)
declare @COURSEPK int
set @COURSEID = '111111111111'
set @COURSEPK = (select pk1 from course_main where course_id = '111111111111')
print @coursePK
SELECT *
FROM group_attempt_files where group_attempt_pk1 in(
select pk1 from group_attempt where gradebook_main_pk1 in (
select pk1 from gradebook_main where crsmain_pk1 in (
select pk1 from course_main where course_id = @COURSEID)
) and groups_pk1 is NULL);
SELECT *
FROM attempt where group_attempt_pk1 in (
select pk1 from group_attempt where gradebook_main_pk1 in (
select pk1 from gradebook_main where crsmain_pk1 in (
select pk1 from course_main where course_id = '111111111111'
)
) and groups_pk1 is NULL);
SELECT *
FROM attempt where group_attempt_pk1 in (
select pk1 from group_attempt where gradebook_main_pk1 in (
select pk1 from gradebook_main where crsmain_pk1 = @COURSEPK)
and groups_pk1 is NULL);
SELECT *
FROM group_attempt where pk1 in(
select pk1 from group_attempt where gradebook_main_pk1 in (
select pk1 from gradebook_main where crsmain_pk1 in (
select pk1 from course_main where course_id = @COURSEID
)
) and groups_pk1 is NULL);
@hanleybrand
Copy link
Author

the problem seems to be that the SELECT * FROM attempt query doesn't return any results

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment