Hi Jill,
If I understand you correctly, that's what you need:
assuming that hour column is NUMBER and type is CHAR
SELECT ssn SSN,
week DATE,
decode(type,'REG',hour,0) REG,
decode(type,'SICK',hour,0) SICK,
decode(type,'VACATION',hour,0) VAC,
xxxxxxxxxxx,
xxxxxxxxxxxx,
xxxxxxxxxxxxxxx,
FROM table
WHERE xxxxxxxxxxxx
GROUP BY DATE,SSN
ORDER BY 1;
Regards,
Mitch.
Jill <jc_va_at_hotmail.com> wrote in message
news:7qgo2b$n25$1_at_bgtnsc02.worldnet.att.net...
> Tabular Report
>
> I have a table that has SSN, Week,Type, and Hours. Type is for a pay type
> such as Regular, Sick, Vacation, etc. I would like to have an SQL query
> produce a report in a tabular format as such:
>
> SSN DATE REG SICK etc.
> xxx-xx-xxxx 8/29/99 32 8 etc.
>
> The universe of earnings types is finite and is about 8. Other than
having
> a view made up of UNION ALL statements, is there another way to do this?
>
>
>
Received on Tue Aug 31 1999 - 18:51:02 CDT