Daily Archives: July 19, 2011

1 post

How to use conditional CASE statement in Oracle WHERE clause to retrieve data

Here is the table structure that I need to query: UserID Type Name Department Status Classification Enrollment_Status Where “Type” and “Department” are foreign keys of the other two tables. The query criteria are: If the user type is “Student” (type ID = 1), then only retrieve enrolled students (Enrollment_Status = ‘EN’); If the user type is not “Student” (type ID <> 1), then check Classification field and only retrieve data with Classification <> ‘R’ It […]