returning YES/NO conditionally
I have a table for recording maintenance actions on large ships. The table has a "task_number" column (a code to identify the task) and a "task_class" column which refers to each ship type (small, medium or large ships, for instance). The task numbers are not the PK, and there are duplicates. Each record contains the task number, task class, and more associated information. The task number and task class are never null. I would like to run a query that would return something like this:
If the table contained data such as
TASK_NUMBER | TASK_CLASS
X-3161-0 | SMALL
X-3161-0 | LARGE
X-1984-3 | LARGE
P-3535-1 | MEDIUM
P-3535-1 | SMALL
P-3535-1 | LARGE
TASK_NUMBER | SMALL? | MEDIUM? | LARGE?
X-3161-0 | YES | NO | YES
X-1984-3 | NO | NO | YES
P-3535-1 | YES | YES | YES
So, as you can see, every task number should be included, and then the class applicability follows. I do know ahead of time what all of the "classes" are--I don't have to figure that out at run time.
If this can be done easily with plain SQL, I would appreciate it, but PL/SQL is acceptable too.