Question : Select Statement with Function

Hello,

I have the following Stored Procedure below that works BUT only displays the users information if the testid is either a 2 or 8. I still need to be able to display all users that have a testid of 2 or 8 but also if they have other values associated with them, for example a testid value may be 2, 5, 7, or 8. This Stored Procedure is setup to pull all user information based on 2 and or 8. So if user has a testid 2, 5, and 8 the current Stored Procedure below will not display the users information.


ALTER PROCEDURE [dbo].[PSSA_MathReadingModifiedLocationReport]

@site_id int

As
 

select s.student_id, s.firstname, s.lastname, s.dob, s.gender, s.ethnicity, s.phone, s.entrydate, s.pasecureid, s.povertycode, s.spedaccnotes, s.teacher, dbo.MathReadingModifiedTests(s.student_id) testname, s.grd_id, g.grd_id, g.grd_level, si.site_id, si.site_name, i.iep_id, i.iep_type
From pssa_students as s
Join pssa_sites as si On s.site_id = si.site_id
Join pssa_grades as g On s.grd_id = g.grd_id
Join pssa_iep as i On s.iep_id = i.iep_id
where si.site_id = @site_id
--and not exists( select null from PSSA_STUDENTS_TESTS t where t.student_id = s.student_id and t.testid in (5,7))
and not exists( select null from PSSA_STUDENTS_TESTS t where t.student_id = s.student_id and t.testid in (5,7))

Answer : Select Statement with Function

I haven't read the text carefully, but I think you can clone (if you need this).
Please read the document carefully
http://youngcow.net/doc/oracle10g/em.102/b16227/oui7_cloning.htm
Random Solutions  
 
programming4us programming4us