I'm trying to get both fundcat on one line. All of the remaining fields in the record are the same (this should be grouped). I typed the output in the original post. I could not get the function or SQL statement to produce the desired output.
Looking a few of your answers from other posts I think that a function would be appropriate(unsure about if a create or replace function would work).
I know what I want the output to look like.
Below is the sql that I think may work
User-defined function)
create or replace function fcat...
Here is the output from a select statement:
1 select FCAT, TC, TT, VCAT, BOC, ENTRY , ACEV, DESCR, DB, CR, DB2, CR2, DB3, CR3, DB4, CR4, EDAT
2 from fms_glfcat
3 where fcat in ( 'V ' , 'NV')
4 AND ENTRY LIKE '1243%'
5* ORDER BY ENTRY, FCAT
SQL> /
FC TC TT V BOC ENTR ACEV DESCR...
When I try the max(edate) function it get the following error:
SQL> select u.EDATE, u.USERID_2,
2 COUNT(CASE WHEN CLEARED IS NULL
3 THEN 'X'
4 ELSE NULL END) A ,
5 COUNT(CASE WHEN CLEARED = 'N'
6 THEN 'X'
7 ELSE NULL END) B ,
8...
Does anyone know how to write a script to count a record (T_NUM) once so that it is capture in the stats for the first date and excluded from all future dates?
T_NUM EDATE
------------ ---------
797PR6005 05-DEC-06
797Q70015 05-DEC-06
797Q70015 06-DEC-06
797Q70015...
I got it to work. It took a long time to run.
Is it possible to get the pecentage of the unfixed compared to the total from the the sql statement below (A)?
EDATE USERID_2 FIXED UNFIXED TOTAL
--------- -------- --------- --------- ---------
05-DEC-06 SXXXMRR 1 8...
After messing with the code it looks like I am onto something. I did not want to update the whole table so I adde the edates. I have remove them and currently running the following code:
UPDATE SUSF u SET CLEARED = 'N'
where EXISTs (
SELECT...
SQL> UPDATE SUSF u SET CLEARED = 'N'
2 WHERE EDATE IN ('01-DEC-06' , '30-NOV-06' )
3 AND EXIST (
4 SELECT '?' FROM SUSF q
5 WHERE q.EDATE = u.EDATE + 1
6 AND q.USERID_2||q.B_C||q.B_AO||q.B_NUM||q.T_C||q.AO||q.T_NUM
7 =...
SQL> UPDATE SUSF SET CLEARED = 'N'
2 WHERE EDATE IN ('01-DEC-06' , '30-NOV-06')
3 AND Q.USERID_2||Q.B_C||Q.B_AO||Q.B_NUM||Q.T_C||Q.AO||Q.T_NUM
4 EXISTS (
5 SELECT U.USERID_2||U.B_C||U.B_AO||U.B_NUM||U.T_C||U.AO||U.T_NUM FROM SUSF q
6 WHERE Q.EDATE =...
Im still stuck. Any ideas on how to fix the code below:
UPDATE SUSF SET CLEARED = 'N'
WHERE EDATE IN ('01-DEC-06' , '30-NOV-06')
AND Q.USERID_2||Q.B_C||Q.B_AO||Q.B_NUM||Q.T_C||Q.AO||Q.T_NUM
EXISTS (
SELECT U.USERID_2||U.B_C||U.B_AO||U.B_NUM||U.T_C||U.AO||U.T_NUM FROM...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.