Can somebody please help me with this. I can't seem to get on how to output this... (if possible, that is)
pls refer here:
TABLE1
Quote:
jobid personnel errortype
0001 dave TYPO
0001 dave TYPO
0001 dave ME
0003 justin IBM
0004 craig TYPO
0004 craig IBM
|
I should display the number of errortypes of every personnel from that particular jobid. So i did this one...
Quote:
SELECT
COUNT (DISTINCT jobid) AS Jobs,
personnel,
SUM(errortype) AS Total_Error
FROM table
GROUP BY personnel
|
Well, if it is just counting and adding the errortypes, I think I got that right but this is the conditions given to me...
- If the certain jobid has multiple errortypes (refer to jobid 0001), it should always count as just
1
- If the certain jobid has an
IBM errortype, it will equivalently count as
3 already
- And if the certain jobid has an IBM errortype and other kinds of errortype (refer to jobid 0004), it should only count just the IBM errortype ignoring other errortypes of that jobid, so the error count will be just
3
What do you think?
