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...
I need help fixing the update statement below.
The update statement updates all of the records on the table for a specific day. This is not what I want to happen.
I would like the cleared field updated with an ‘N’ if the concatenated fields is found in a subset of concatenated fields (ref...
Im taking a different approach. Does anyone know how to speed this query up?
SELECT EDATE, USERID_2||B_C||B_AO||B_NUM||T_C||AO||T_NUM FROM SUSF
WHERE SUBSTR(USERID_2,1,1) IN ('R' , 'S') AND EDATE + 1 IN (SELECT EDATE FROM SUSF)
AND USERID_2||B_C||B_AO||B_NUM||T_C||AO||T_NUM IN (SELECT...
I looking for ideas an easy to show progress.
Example:
Date Record USER
01/01/2006 A CAT
01/01/2006 B DOG
01/02/2006 A CAT
01/02/2006 C CAT
01/03/2006 A CAT
01/03/2006 C CAT
01/03/2006 D MOUSE
In the...
I need an sql script to manage progress when thing are constantly changing.
Below is a layout of the tmp_susf table and count of the records by date.
Inside of this table are records from each day--some leaving and
new ones added. Does anyone have an idea as to how to show progress or a lack...
LK
Same concept different file. I can the the sql to just select a specific date (TDATE). Any ideas why?
Set Pages 0 Feed Off Ver Off Term Off Trims On Lin 200
Spo C:/_AL_FILES/SQL/GLFCAT.SQL
Prompt Set Pages 55 Feed On Ver On Term On Trims On Lin 200
Select 'Spo '||FUNDCAT||'.txt'||Chr(10)...
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.