Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL Question
Hi Matthias,
Thanks for your reply, I really appreciate it, however I am still
having a problem.
Your date select statement is working perfectly, and this is probably
my fault for not making it clearer in my first post. I need to count
'types' of defect that occur on each day, not EVERY defect that occurs
as identified by FIND_ID.
Defect 'Types' are identifed by DEFECTIVE_SUBSYSTEM,
DEFECT_SYMPTOM_CODE, PROBLEM_TYPE, DEFECTIVE_PART
DEFECTIVE_CONNECTOR, DEFECT_CAUSE, ACTION_TAKEN...
in other words, the fields in VIEW_1 and hence the reason for creating
the View.
The output View I am hoping to obtain would look something like:-
Date|Subsys|Symptom|Prob|Part|Conn.|Cause|Action| Count
-1 Su1 Sy1 Pr1 Pa1 Co1 Ca1 Ac1 12 -2 Su2 Sy2 Pr2 Pa2 Co2 Ca2 Ac2 40 -3 Su3 Sy3 Pr3 Pa3 Co3 Ca3 Ac3 27..etc
Where Count is the number of FIND_ID's of each defect 'Type' for a particular day and each of the defect attributes are grouped. If that makes any sense !! :o)
Sorry for any confusion - I hope you can help
Best Regards
Matt
On 8 Apr 1998 12:11:30 GMT, GreMa_at_t-online.de (Matthias Gresz) wrote:
>Hi Matt,
>
>I'd add FIND_ID to your VIEW_1 to have all distinguished defects in your view. WORK_STATION_ID allone would not be enough since some defects may occur twice in a few days. Assuming you add FIND_ID
>try:
>
>
>SELECT
> TO_CHAR(SYSDATE-1, 'MM/DD/YYYY'), COUNT(FIND_ID) NUMBER_OF_DEFECTS
> FROM
> VIEW_1 v, TABLE_1 t
> WHERE
> v.FIND_ID=t.FIND_ID
> AND
Received on Wed Apr 08 1998 - 18:16:15 CDT