How to group these values by month?
HelloI have a nice SQL statement that returns from day to day, the values of a device.
WITH S1 AS
(SELECT DATE1,
ROUND(AVG(VALEUR),2) Debit
FROM EVV_E032
WHERE DATE1 BETWEEN TO_DATE('01012006000000', 'DDMMYYYYHH24MISS') AND TO_DATE('31122006235959', 'DDMMYYYYHH24MISS')
AND CLEF_VAR =
(SELECT CLEF_VAR FROM SITE_DEBIT_RIVIERE WHERE SITE = 'E032'
)
GROUP BY date1
)
SELECT NULL LINK ,
TO_CHAR(n, 'DD.MM'),
NVL(ROUND(AVG(Debit),2), 0) "Débit"
FROM
(SELECT TRUNC(TRUNC(to_date(2006,'YYYY'),'year'), 'DD')-1 + level n,
rownum jours
FROM dual CONNECT BY level<=366
) days
LEFT JOIN s1
ON days.n = TRUNC(date1,'DD')
GROUP BY n
ORDER BY n
Sample values:Insert into "EVV_E032" (DATE1,DEBIT) values (to_date('10/02/2006 09:49:59','DD/MM/YYYY HH24:MI:SS') 1,63);
Insert into "EVV_E032" (DATE1,DEBIT) values (to_date('21/02/2006 10:35:12','DD/MM/YYYY HH24:MI:SS') 1,68);
Insert into "EVV_E032" (DATE1,DEBIT) values (to_date('21/02/2006 11:30:30','DD/MM/YYYY HH24:MI:SS') 0);
Insert into "EVV_E032" (DATE1,DEBIT) values (to_date('23/02/2006 14:02:02','DD/MM/YYYY HH24:MI:SS') 0);
Insert into "EVV_E032" (DATE1,DEBIT) values (to_date('23/02/2006 16:22:34','DD/MM/YYYY HH24:MI:SS') 0);
Insert into "EVV_E032" (DATE1,DEBIT) values (to_date('30/04/2006 18:09:08','DD/MM/YYYY HH24:MI:SS') 1,72);
Insert into "EVV_E032" (DATE1,DEBIT) values (to_date('20/05/2006 11:57:02','DD/MM/YYYY HH24:MI:SS') 1,72);
Insert into "EVV_E032" (DATE1,DEBIT) values (to_date('07/06/2006 15:11:58','DD/MM/YYYY HH24:MI:SS') 1,79);
Insert into "EVV_E032" (DATE1,DEBIT) values (to_date('08/06/2006 20:00:26','DD/MM/YYYY HH24:MI:SS') 1,82);
Insert into "EVV_E032" (DATE1,DEBIT) values (to_date('19/06/2006 09:42:32','DD/MM/YYYY HH24:MI:SS') 1,72);
Insert into "EVV_E032" (DATE1,DEBIT) values (to_date('20/06/2006 04:30:00','DD/MM/YYYY HH24:MI:SS') 1,82);
Insert into "EVV_E032" (DATE1,DEBIT) values (to_date('20/06/2006 10:39:01','DD/MM/YYYY HH24:MI:SS') 1,72);
Insert into "EVV_E032" (DATE1,DEBIT) values (to_date('24/06/2006 19:34:50','DD/MM/YYYY HH24:MI:SS') 1,82);
Insert into "EVV_E032" (DATE1,DEBIT) values (to_date('26/06/2006 14:37:26','DD/MM/YYYY HH24:MI:SS') 1,88);
The output are grouped values from day to day. I would like to tehse group monthly values, but couldn't figure out how to do. Even if I'm not a newbie to newbie on SQL, copy the following code will much too much for me. I know that some of you guys can handle that. I tried but not sew succeed. Could you help me?Best regards, Christian.
select add_months(to_date('01/01/2006', 'dd/mm/yyyy'), level - 1) n,
rownum
from dual
connect by level <= 12;
N ROWNUM
--------- ----------
01-JAN-06 1
01-FEB-06 2
01-MAR-06 3
01-APR-06 4
01-MAY-06 5
01-JUN-06 6
01-JUL-06 7
01-AUG-06 8
01-SEP-06 9
01-OCT-06 10
01-NOV-06 11
01-DEC-06 12
Tags: Database
Similar Questions
-
Does anyone know how to group this analysis? I have a report where I calculated the difference between A and B percentage value. So, now I have to classify this difference in the following order:
ABS (difference %) = 0-15%
ABS (difference %) = 16-30%
ABS (difference %) = - 31-50%
ABS (difference %) > 50%
I don't know how the work of service ABS, I'm not sure how Group the... This could be an easy fix.
You will appreciate the help.
Try something like
case
When ABS (difference %) > = 0 and ABS (difference %)<=15 then=""> =15>
when ABS (difference %) > 15 and ABS (difference %)<=30 then=""> =30>
when ABS (difference %) > 30 and ABS (difference %)<=50 then=""> =50>
when ABS (difference %) > 51 then ' > 50% '
end
I guess ABS (difference %) returns a number
-
How to group the values according to the weeks of the year?
Hello
I have a table with dates and values (I'm simplifying the need for this question)
I want to group the values (and adding the) according to the 52 weeks of the year. I mean week of consolidation for the week.
Here the date of each weeks generated during a year, it gives every Monday of each week of the year:
Select trunc (trunc (sysdate, 'year'), 'iw') +(rownum*7)-7 n of object where rownum < = 53
What I want to do is to summarize the values in my table and group together them in every week, in that respect. The date of these weeks are generated by the above query.
For example all values fall into the 1st week of the year will be grouped into this date, all values fall in the 2nd wek will be grouped in this date and so on. If no value is found for a week, then a value of 0 is generated in iorder have a 52 weeks-lines. It's basically a kind of select with "date between... and...". "and group values and that affect the number of the wee, they are relevant.
Examples of Monday, June 30, 2008, 07/07/2008, 07/14/2008
Example of values and dates in my table:
Date value
30/06/08 9
07/01/08 9
07/02/08 9
07/03/08 9
07/03/08 9
07/04/08 6
07/04/08 6
07/04/08 9
07/07/08 9
07/08/08 9
29/07/08 9
29/07/08 6
30/07/08 9
07/31/08 9
07/31/08 9
07/31/08 9
08/01/08 9
08/04/08 5.5
08/04/08 9
08/07/08 9
08/07/08 9
08/08/08 9
14/08/08 9
14/08/08 9
18/08/08 9
22/08/08 9
22/08/08 9
25/08/08 9
25/08/08 9
26/08/08 9
29/08/08 9
29/08/08 9
09/01/08 9
09/01/08 9
09/04/08 9
09/04/08 9
09/05/08 9
09/05/08 9
09/05/08 9
09/05/08 9
17/09/08 9
Result should be something like this:
Number of the week Date value
47/1 12/31/2008
94/2 07/12/2008
2008-01-14 3, 23
and so on...
.....
73/52 12/22/2008
60/53 29/12/2008
I hope I am clear. Thank you for your kind replies.Something like that, maybe:
select trunc(trunc(sysdate,'year'),'iw') +((level-1)*7) n from dual connect by level<=53
(I changed it to sysdate so that the next years will take care of them!)
-
How to get the value of the collection
Oracle 10 g versionHi gurus
Thank you someone guide me how get my data collection. See below for more details.
Examples of data
Set serveroutput on
DECLARE
Numbers_t TYPE TABLE IS OF INTEGER
INDEX BY PLS_INTEGER;
l_numbers numbers_t;
Start
FOR indx IN 1... 10
loop
l_numbers (DBMS_RANDOM. (VALUE (1, 10)): = indx;
dbms_output.put_line ('Count =' | l_numbers);
END loop;END;
I know that in the collection of the values of number_t are store in the place at random, my question is that how to see these values?
Did you look at?
SQL> declare 2 type numbers_t is table of integer 3 index by pls_integer; 4 l_numbers numbers_t; 5 counter integer; 6 begin 7 for indx in 1 .. 10 8 loop 9 l_numbers (dbms_random.value (1, 100)) := indx; 10 end loop; 11 12 counter := l_numbers.first; 13 while counter is not null 14 loop 15 dbms_output.put_line('Index is ' || counter || ' and value is ' || l_numbers(counter)); 16 counter := l_numbers.next(counter); 17 end loop; 18 end; 19 / Index is 10 and value is 4 Index is 18 and value is 3 Index is 42 and value is 6 Index is 52 and value is 8 Index is 57 and value is 10 Index is 68 and value is 2 Index is 78 and value is 9 Index is 88 and value is 7 Index is 90 and value is 5 PL/SQL procedure successfully completed.
-
ASD service - how to get the values of Description and reason in the workflow
Hi all
I've created a workflow-based service of ASD. When the catalog of the ASD is requested, the first tab is 'Request information' which has the field description and reason. How to access these values to the underlying stream.
Thank you
Hello
Here's a simple solution:
ASDRequestId = System.getContext () .getParameter ("__asd_catalogRequestId");
ASDRequest = vCACCAFEEntitiesFinder.getCatalogItemRequest(vRA_CAFEHost,ASDRequestId);
Request_Reason = ASDRequest.reasons;
Request_Description = ASDRequest.description;
Request_Owner = ASDRequest.requestedFor;
-
Hi all
If I run this query using a tool like developer PL/SQL (SQL window), the values are displayed as a Collection. Just click and see the results of the al.
Select
dbms_resconfig.getRepositoryResConfigPaths)
Of
Double;
I want to know how to display these values using any tool of sqlplus (with dbms_output or something like that).
How can I do? With the help of the table? Create a type?
TKSuser12083350 wrote:
I want to know how to display these values using any tool of sqlplus (with dbms_output or something like that).
SQL> select * from table(dbms_resconfig.getRepositoryResConfigPaths()) 2 / COLUMN_VALUE -------------------------------------------------------------------------------- /sys/xs/userrc.xml /sys/xs/rolesetrc.xml /sys/xs/drolerc.xml /sys/xs/rolerc.xml /sys/xs/frolerc.xml /sys/xs/xdserc.xml /sys/xs/scrc.xml 7 rows selected. SQL>
And in PL/SQL:
SQL> declare 2 v_list xdb$string_list_t := dbms_resconfig.getRepositoryResConfigPaths(); 3 begin 4 for i in 1..v_list.count loop 5 dbms_output.put_line(v_list(i)); 6 end loop; 7 end; 8 / /sys/xs/userrc.xml /sys/xs/rolesetrc.xml /sys/xs/drolerc.xml /sys/xs/rolerc.xml /sys/xs/frolerc.xml /sys/xs/xdserc.xml /sys/xs/scrc.xml PL/SQL procedure successfully completed. SQL>
SY.
Published by: Solomon Yakobson, April 24, 2010 15:04
-
In my esperiments I get certain values such as the inf and Nan and I want to eliminate these values before you save my table in a file because then I would take the average of those values that are stored in a file
How can I do this?
Thank you
Here's a quick example:
Make sure you use not A number/path/Refnum? Function, because direct comparisons with for example a diagram NaN constant could give surprising (for some) results. For example, you think you could add a NaN value to the constant table diagram and remove some code, it is not working properly.
(Of course if you have an older version of LabVIEW, you might not have the conditional tunnel. In such a case, it should be a bit more code in view)
-
How to group and summarize the values with a vertical drop of 100?
Dear gurus
How to group and summarize the values with a vertical drop of 100 as the data indicated below:
Cas_Cod_ Cas_Amt_ Description
300 1000A
301 200 B
302 350 C
400 500 A
401 100 B
402 25
Now the data should be grouped like this
A (300,400) = 1500
(301,401) B = 300
C (302,402) = 375
Make sure that I don't have a column as description in my table to group data on description, its here just to give u an example.Hello
using mod for hundreds:
with x as ( select 300 code, 1000 amt, 'A' descr from dual union all select 301 code, 200 amt, 'B' descr from dual union all select 302 code, 350 amt, 'C' descr from dual union all select 400 code, 500 amt, 'A' descr from dual union all select 401 code, 100 amt, 'B' descr from dual union all select 402 code, 25 amt, 'C' descr from dual ) select mod(code,100) code, sum (amt) from x group by mod(code,100);
Using the mod you get the rest of a division, so mod (300,100) = 0, mod (301,100) = 1, etc.
Herald tiomela
http://htendam.WordPress.com -
How to use the value in a combo box as a parameter "with these values?
Hello, new user.
I have a box of drop-down list on Page 1, on which the user can choose a number of study. The list box is named "P1_STUDY_NBR".
Then I have a list, a single entry that goes to my form master / detail, which is Page 6. I would like him to go the number of study that the user choose on Page 1.
In my goal on the list to create/edit entry, I put in the 'Page of this Application"," Page 6 ", then in any of these items, I put in."
P6_STUDY_NBR
My question is what to use with these values, where I want the content of the P1_STUDY_NBR. I tried:
& P1_STUDY_NBR
and it does not work. If I put in one of the numbers in the study, as 336-00, then it works, but I want to increase the number of study that the user chooses in the drop-down list. What should I do for P1_STUDY_NBR content?
-MaryHello
The format should be:
&P1_STUDY_NBR.
You seem to miss the point at the end
Andy
-
How to get the values based on the most recent date
Oracle Version 8i
How to get the new_value based on the most recent date
SELECT max (MODIFIED_ON), the Group LOG_ITEM_CHARACTERISTICS by MODIFIED_ON new_value - does not
Please, someone help me
CREATE TABLE LOG_ITEM_CHARACTERISTICS ( CHAR_LOG_ID NUMBER(10) NOT NULL, PIRM_ID VARCHAR2(8) NOT NULL, CONSTANT_FLAG VARCHAR2(1), CHARACTERISTIC_NAME VARCHAR2(25) NOT NULL, TYPE_NAME VARCHAR2(10) NOT NULL, NEW_VALUE VARCHAR2(3000), UOM VARCHAR2(10), MODIFIED_BY VARCHAR2(30), MODIFIED_ON DATE ) SET DEFINE OFF; Insert into LOG_ITEM_CHARACTERISTICS (CHAR_LOG_ID, PIRM_ID, CONSTANT_FLAG, CHARACTERISTIC_NAME, TYPE_NAME, NEW_VALUE, UOM, MODIFIED_BY, MODIFIED_ON) Values (187376, '0307490N', 'N', 'OUTPUT CURRENT', 'PS2030/WVL', '1', 'AMPS', 'EMPXD88', TO_DATE('10/25/1999 00:00:00', 'MM/DD/YYYY HH24:MI:SS')); Insert into LOG_ITEM_CHARACTERISTICS (CHAR_LOG_ID, PIRM_ID, CONSTANT_FLAG, CHARACTERISTIC_NAME, TYPE_NAME, NEW_VALUE, UOM, MODIFIED_BY, MODIFIED_ON) Values (187377, '0307490N', 'N', 'OUTPUT VOLTAGE', 'PS2030/WVL', '54.9', 'VOLTS', 'EMPXD88', TO_DATE('09/22/1998 00:00:00', 'MM/DD/YYYY HH24:MI:SS')); Insert into LOG_ITEM_CHARACTERISTICS (CHAR_LOG_ID, PIRM_ID, CONSTANT_FLAG, CHARACTERISTIC_NAME, TYPE_NAME, NEW_VALUE, UOM, MODIFIED_BY, MODIFIED_ON) Values (187378, '0307490N', 'N', 'OUTPUT CURRENT', 'PS2030/WVL', '0', 'AMPS', 'EMDXB88', TO_DATE('09/22/1998 00:00:00', 'MM/DD/YYYY HH24:MI:SS')); Insert into LOG_ITEM_CHARACTERISTICS (CHAR_LOG_ID, PIRM_ID, CONSTANT_FLAG, CHARACTERISTIC_NAME, TYPE_NAME, NEW_VALUE, UOM, MODIFIED_BY, MODIFIED_ON) Values (187384, '0307490N', 'N', 'OUTPUT CURRENT', 'PS2030/WVL', '2', 'AMPS', 'EMAXC29', TO_DATE('11/10/2000 00:00:00', 'MM/DD/YYYY HH24:MI:SS')); Insert into LOG_ITEM_CHARACTERISTICS (CHAR_LOG_ID, PIRM_ID, CONSTANT_FLAG, CHARACTERISTIC_NAME, TYPE_NAME, NEW_VALUE, UOM, MODIFIED_BY, MODIFIED_ON) Values (187385, '0307490N', 'N', 'OUTPUT VOLTAGE', 'PS2030/WVL', '55.1', 'VOLTS', 'EMAXC29', TO_DATE('10/19/2001 00:00:00', 'MM/DD/YYYY HH24:MI:SS')); Insert into LOG_ITEM_CHARACTERISTICS (CHAR_LOG_ID, PIRM_ID, CONSTANT_FLAG, CHARACTERISTIC_NAME, TYPE_NAME, NEW_VALUE, UOM, MODIFIED_ON) Values (2400742, '0307490N', 'N', 'MEASURED LOAD ON PER', 'PS2030/WVL', '2', 'AMPS', TO_DATE('10/19/2001 00:00:00', 'MM/DD/YYYY HH24:MI:SS')); Insert into LOG_ITEM_CHARACTERISTICS (CHAR_LOG_ID, PIRM_ID, CONSTANT_FLAG, CHARACTERISTIC_NAME, TYPE_NAME, NEW_VALUE, UOM, MODIFIED_BY, MODIFIED_ON) Values (574093, '0307490N', 'N', 'MEASURED LOAD ON PER', 'PS2030/WVL', '2', 'AMPS', 'EMCTH88', TO_DATE('12/13/2002 11:55:16', 'MM/DD/YYYY HH24:MI:SS')); Insert into LOG_ITEM_CHARACTERISTICS (CHAR_LOG_ID, PIRM_ID, CONSTANT_FLAG, CHARACTERISTIC_NAME, TYPE_NAME, NEW_VALUE, UOM, MODIFIED_BY, MODIFIED_ON) Values (574094, '0307490N', 'N', 'OUTPUT VOLTAGE', 'PS2030/WVL', '54.9', 'VOLTS', 'EMCTH88', TO_DATE('12/13/2002 11:55:16', 'MM/DD/YYYY HH24:MI:SS')); Insert into LOG_ITEM_CHARACTERISTICS (CHAR_LOG_ID, PIRM_ID, CONSTANT_FLAG, CHARACTERISTIC_NAME, TYPE_NAME, NEW_VALUE, UOM, MODIFIED_BY, MODIFIED_ON) Values (3131486, '0307490N', 'N', 'MEASURED LOAD ON PER', 'PS2030/WVL', '6', 'AMPS', 'EMCTH88', TO_DATE('12/16/2004 14:31:14', 'MM/DD/YYYY HH24:MI:SS')); Insert into LOG_ITEM_CHARACTERISTICS (CHAR_LOG_ID, PIRM_ID, CONSTANT_FLAG, CHARACTERISTIC_NAME, TYPE_NAME, NEW_VALUE, UOM, MODIFIED_BY, MODIFIED_ON) Values (3131487, '0307490N', 'N', 'LAST MEASURED DATE', 'PS2030/WVL', '16-12-04', 'DD/MM/YY', 'EMCTH88', TO_DATE('12/16/2004 14:31:14', 'MM/DD/YYYY HH24:MI:SS')); Insert into LOG_ITEM_CHARACTERISTICS (CHAR_LOG_ID, PIRM_ID, CONSTANT_FLAG, CHARACTERISTIC_NAME, TYPE_NAME, NEW_VALUE, MODIFIED_BY, MODIFIED_ON) Values (3131488, '0307490N', 'Y', 'POWER SUPPLY', 'PS2030/WVL', 'ESSENTIAL', 'EMCTH88', TO_DATE('12/16/2004 14:31:14', 'MM/DD/YYYY HH24:MI:SS')); Insert into LOG_ITEM_CHARACTERISTICS (CHAR_LOG_ID, PIRM_ID, CONSTANT_FLAG, CHARACTERISTIC_NAME, TYPE_NAME, NEW_VALUE, UOM, MODIFIED_BY, MODIFIED_ON) Values (3131489, '0307490N', 'N', 'OUTPUT VOLTAGE', 'PS2030/WVL', '54.9', 'VOLTS', 'EMCTH88', TO_DATE('12/16/2004 14:31:14', 'MM/DD/YYYY HH24:MI:SS')); Insert into LOG_ITEM_CHARACTERISTICS (CHAR_LOG_ID, PIRM_ID, CONSTANT_FLAG, CHARACTERISTIC_NAME, TYPE_NAME, NEW_VALUE, UOM, MODIFIED_BY, MODIFIED_ON) Values (4759086, '0307490N', 'N', 'MEASURED LOAD ON PER', 'PS2030/WVL', '6', 'AMPS', 'EMRCT88', TO_DATE('11/15/2007 14:33:03', 'MM/DD/YYYY HH24:MI:SS')); Insert into LOG_ITEM_CHARACTERISTICS (CHAR_LOG_ID, PIRM_ID, CONSTANT_FLAG, CHARACTERISTIC_NAME, TYPE_NAME, NEW_VALUE, UOM, MODIFIED_BY, MODIFIED_ON) Values (4759087, '0307490N', 'N', 'OUTPUT VOLTAGE', 'PS2030/WVL', '54.9', 'VOLTS', 'EMRCT88', TO_DATE('11/15/2007 14:33:03', 'MM/DD/YYYY HH24:MI:SS')); Insert into LOG_ITEM_CHARACTERISTICS (CHAR_LOG_ID, PIRM_ID, CONSTANT_FLAG, CHARACTERISTIC_NAME, TYPE_NAME, NEW_VALUE, UOM, MODIFIED_BY, MODIFIED_ON) Values (4759088, '0307490N', 'N', 'LAST MEASURED DATE', 'PS2030/WVL', '14/11/07', 'DD/MM/YY', 'EMRCT88', TO_DATE('11/15/2007 14:33:03', 'MM/DD/YYYY HH24:MI:SS')); Insert into LOG_ITEM_CHARACTERISTICS (CHAR_LOG_ID, PIRM_ID, CONSTANT_FLAG, CHARACTERISTIC_NAME, TYPE_NAME, NEW_VALUE, UOM, MODIFIED_BY, MODIFIED_ON) Values (6646012, '0307490N', 'N', 'MEASURED LOAD ON PER', 'PS2030/WVL', '5', 'AMPS', 'PAUL DEVERILL', TO_DATE('01/06/2011 12:56:17', 'MM/DD/YYYY HH24:MI:SS')); Insert into LOG_ITEM_CHARACTERISTICS (CHAR_LOG_ID, PIRM_ID, CONSTANT_FLAG, CHARACTERISTIC_NAME, TYPE_NAME, NEW_VALUE, MODIFIED_BY, MODIFIED_ON) Values (6646013, '0307490N', 'Y', 'BATT TEST SET AT 3M', 'PS2030/WVL', 'null', 'PAUL DEVERILL', TO_DATE('01/06/2011 12:56:17', 'MM/DD/YYYY HH24:MI:SS')); Insert into LOG_ITEM_CHARACTERISTICS (CHAR_LOG_ID, PIRM_ID, CONSTANT_FLAG, CHARACTERISTIC_NAME, TYPE_NAME, NEW_VALUE, MODIFIED_BY, MODIFIED_ON) Values (6646014, '0307490N', 'Y', 'CAP ALARM INHIBITED', 'PS2030/WVL', 'null', 'PAUL DEVERILL', TO_DATE('01/06/2011 12:56:17', 'MM/DD/YYYY HH24:MI:SS')); Insert into LOG_ITEM_CHARACTERISTICS (CHAR_LOG_ID, PIRM_ID, CONSTANT_FLAG, CHARACTERISTIC_NAME, TYPE_NAME, NEW_VALUE, UOM, MODIFIED_BY, MODIFIED_ON) Values (6646015, '0307490N', 'N', 'OUTPUT VOLTAGE', 'PS2030/WVL', '55', 'VOLTS', 'PAUL DEVERILL', TO_DATE('01/06/2011 12:56:17', 'MM/DD/YYYY HH24:MI:SS')); Insert into LOG_ITEM_CHARACTERISTICS (CHAR_LOG_ID, PIRM_ID, CONSTANT_FLAG, CHARACTERISTIC_NAME, TYPE_NAME, NEW_VALUE, MODIFIED_BY, MODIFIED_ON) Values (6646016, '0307490N', 'Y', 'YR ROUTINES REQUIRED', 'PS2030/WVL', 'null', 'PAUL DEVERILL', TO_DATE('01/06/2011 12:56:17', 'MM/DD/YYYY HH24:MI:SS')); Insert into LOG_ITEM_CHARACTERISTICS (CHAR_LOG_ID, PIRM_ID, CONSTANT_FLAG, CHARACTERISTIC_NAME, TYPE_NAME, NEW_VALUE, MODIFIED_BY, MODIFIED_ON) Values (6646057, '0307490N', 'Y', 'BATT TEST SET AT 3M', 'PS2030/WVL', 'null', 'PAUL DEVERILL', TO_DATE('01/06/2011 13:03:18', 'MM/DD/YYYY HH24:MI:SS')); Insert into LOG_ITEM_CHARACTERISTICS (CHAR_LOG_ID, PIRM_ID, CONSTANT_FLAG, CHARACTERISTIC_NAME, TYPE_NAME, NEW_VALUE, MODIFIED_BY, MODIFIED_ON) Values (6646058, '0307490N', 'Y', 'CAP ALARM INHIBITED', 'PS2030/WVL', 'null', 'PAUL DEVERILL', TO_DATE('01/06/2011 13:03:18', 'MM/DD/YYYY HH24:MI:SS')); Insert into LOG_ITEM_CHARACTERISTICS (CHAR_LOG_ID, PIRM_ID, CONSTANT_FLAG, CHARACTERISTIC_NAME, TYPE_NAME, NEW_VALUE, MODIFIED_BY, MODIFIED_ON) Values (6646059, '0307490N', 'Y', 'YR ROUTINES REQUIRED', 'PS2030/WVL', 'null', 'PAUL DEVERILL', TO_DATE('01/06/2011 13:03:18', 'MM/DD/YYYY HH24:MI:SS')); Insert into LOG_ITEM_CHARACTERISTICS (CHAR_LOG_ID, PIRM_ID, CONSTANT_FLAG, CHARACTERISTIC_NAME, TYPE_NAME, NEW_VALUE, UOM, MODIFIED_BY, MODIFIED_ON) Values (6648577, '0307490N', 'N', 'MEASURED LOAD ON PER', 'PS2030/WVL', '6', 'AMPS', 'EMPXD88', TO_DATE('01/07/2011 13:35:45', 'MM/DD/YYYY HH24:MI:SS')); Insert into LOG_ITEM_CHARACTERISTICS (CHAR_LOG_ID, PIRM_ID, CONSTANT_FLAG, CHARACTERISTIC_NAME, TYPE_NAME, NEW_VALUE, UOM, MODIFIED_BY, MODIFIED_ON) Values (6648578, '0307490N', 'N', 'OUTPUT VOLTAGE', 'PS2030/WVL', '55', 'VOLTS', 'EMPXD88', TO_DATE('01/07/2011 13:35:45', 'MM/DD/YYYY HH24:MI:SS')); Insert into LOG_ITEM_CHARACTERISTICS (CHAR_LOG_ID, PIRM_ID, CONSTANT_FLAG, CHARACTERISTIC_NAME, TYPE_NAME, NEW_VALUE, MODIFIED_BY, MODIFIED_ON) Values (6648579, '0307490N', 'Y', 'YR ROUTINES REQUIRED', 'PS2030/WVL', 'NULL', 'EMPXD88', TO_DATE('01/07/2011 13:35:45', 'MM/DD/YYYY HH24:MI:SS')); Insert into LOG_ITEM_CHARACTERISTICS (CHAR_LOG_ID, PIRM_ID, CONSTANT_FLAG, CHARACTERISTIC_NAME, TYPE_NAME, NEW_VALUE, MODIFIED_BY, MODIFIED_ON) Values (6648580, '0307490N', 'Y', 'BATT TEST SET AT 3M', 'PS2030/WVL', 'NULL', 'EMPXD88', TO_DATE('01/07/2011 13:36:00', 'MM/DD/YYYY HH24:MI:SS')); Insert into LOG_ITEM_CHARACTERISTICS (CHAR_LOG_ID, PIRM_ID, CONSTANT_FLAG, CHARACTERISTIC_NAME, TYPE_NAME, NEW_VALUE, MODIFIED_BY, MODIFIED_ON) Values (6648581, '0307490N', 'Y', 'CAP ALARM INHIBITED', 'PS2030/WVL', 'NULL', 'EMPXD88', TO_DATE('01/07/2011 13:36:10', 'MM/DD/YYYY HH24:MI:SS')); Insert into LOG_ITEM_CHARACTERISTICS (CHAR_LOG_ID, PIRM_ID, CONSTANT_FLAG, CHARACTERISTIC_NAME, TYPE_NAME, NEW_VALUE, UOM, MODIFIED_BY, MODIFIED_ON) Values (6648634, '0307490N', 'N', 'MEASURED LOAD ON PER', 'PS2030/WVL', '5', 'AMPS', 'EMPXD88', TO_DATE('01/07/2011 13:51:06', 'MM/DD/YYYY HH24:MI:SS')); Insert into LOG_ITEM_CHARACTERISTICS (CHAR_LOG_ID, PIRM_ID, CONSTANT_FLAG, CHARACTERISTIC_NAME, TYPE_NAME, NEW_VALUE, UOM, MODIFIED_BY, MODIFIED_ON) Values (6648635, '0307490N', 'N', 'OUTPUT VOLTAGE', 'PS2030/WVL', '55', 'VOLTS', 'EMPXD88', TO_DATE('01/07/2011 13:51:06', 'MM/DD/YYYY HH24:MI:SS')); COMMIT;
user4587979 wrote:
Hi FrankYes, but I had more than 2 tables with item_characteristics, type_characteristics
If there are other tables involved, then CREATE TABLE and INSERT statements for them (for the relevant columns only). You must not post a lot of examples of data; usually just a couple of lines per table is enough to show the problem.
Also post the results desired from these data.What I try to do is, I'm comparing new_value in log_item_characteristics (whichever is most recent) with CHR_VALUE in the item_characteristics and the needs of different output values
I am trying to query is not giving desired out put
Point out some places where the output is wrong and explain how you get good results in these places, using specific examples from the data sample.
select lic.PIRM_ID, ic.CHR_ID, lic.CHARACTERISTIC_NAME, lic.TYPE_NAME, ic.CHR_VALUE, lic.NEW_VALUE, lic.MODIFIED_BY, lic.MODIFIED_ON, ic.CREATED_BY, ic.CREATED_ON,ic.MODIFIED_BY, ic.MODIFIED_ON from log_item_characteristics lic, item_characteristics ic,type_characteristics tc where lic.TYPE_NAME=tc.TYPE_NAME and lic.CHARACTERISTIC_NAME=tc.CHR_NAME and lic.PIRM_ID=ic.PIRM_ID and tc.CHR_ID=ic.CHR_ID and ic.CHR_VALUE <> lic.NEW_VALUE and lic.pirm_id in ('0307490N','0307521C') order by lic.pirm_id
Thank you; It is useful to see the existing query. Really, you have to format your code.
Please can you help me
What you've posted so far is like saying "I'm going 200 meters to the North, and then 500 meters East, but I'm not getting where I want to go." I would have a better chance to help you if you said, 'I'm out of my house, at 100, Elm Street and try to get to the supermarket at Broadway 279. I'm going 200 meters to the North... ', or, even better. "I want to buy a newspaper and some orange juice, so I thought I'd go to a convenience store. I start at my house, at 100, Elm Street... »
Always post some examples of data (CREATE TABLE and INSERT statements, as you did in your first post) and the desired results from these data. Explain how you get these results from these data. -
How to return the value 0 for no data using the County?
Hi all
I used this query to count the number of records for each month of the year:
SELECT DISTINCT COUNT (I.information_sid) COUNT, TO_DATE (TO_CHAR (INSERT_DATE, 'MM'), 'MM') MONTH
INFORMATION I
TO_DATE GROUP (TO_CHAR (INSERT_DATE, 'MM'), 'MM')
ORDER BY TO_DATE (TO_CHAR (INSERT_DATE, 'MM'), 'MM')
But this code returns no value for months without data
I want to return the value '0' for any month of data. How, please?
Note: I use reports 6i.Maybe this?
SELECT SUM(CNT_REC) CNT_REC, MONTH FROM ( SELECT COUNT(I.information_sid) CNT_REC, TO_DATE(TO_CHAR(INSERT_DATE,'MM'),'MM') MONTH FROM INFORMATIONS I GROUP BY TO_DATE(TO_CHAR(INSERT_DATE,'MM'),'MM') UNION ALL SELECT 0, LPAD(ROWNUM,2,0) FROM ALL_OBJECTS WHERE ROWNUM <= 12 ) GROUP BY MONTH ORDER BY MONTH
No need to SEPARATE during the use of GROUP BY.
-Clément
-
How to write table values to analog channel?
Hi all
If I have a table of values, is it possible to write these values as an analog voltage and then stop writing when he arrives at the end of the table? If so, how does do this?
I have attached my code that generates a table of frequency swept sinusoidal voltages and I write that out to my analog channel, when I consult my output however, I get the same display of sinusoidal repetitive time and time again. I expect for example:
writing of wave of 1 Hz, 2 Hz, 3 Hz etc...
but I'm getting the 1 Hz wave over and over again, I selected samples in the sample clock and pretty much done a lot of trial and error and still no luck . Any help would be appreciated!
Daniel
Hi Daniel!
Take a look at this example (you can find examples of LabVIEW):
Gen CONT tension Wfm - Int Clk - no Regeneration.vi
Here is an another VI I did (see table). It is slightly different from the example of the LV and it should help you.
It could be that useful...
Julien
-
How to connect the value of the input string to numeric values
Hello
I'm trying to figure out how to connect the value of unique user input string to numeric values. Basically I want the user to enter the name of a gas that I have a list for (I think I put the list of gases in a table >). Then I want to match numeric values 2 'a' and 'b', according to which gas, name of the user has set. These 'a' and 'b' values will be automatically matched with the name of the gas in a list that I put. For example, hydrogen gas has the value 3 for "a" and 4 for "b. when the user puts the ' hydrogen' name in a string constant, automatically 'a' and 'b' must be issued.» I have connect a and b to a formula
Thanks for any help
Hello
It is perhaps not exactly what you are looking for, but perhaps you could use the enumerated data type and the array of clusters of points (a, b).
Look at the VI I enclose.
-
How to use the values acquired by different treatments with 9188 OR cDAQ
Hi guys, I'm trying to use NI DAQ 9188 chasis with temperature measurement module 9214. I plugged in 3 modules to the module and split signals. But I'm not sure that I can easily these values in functions. I'm trying to convert them into table 1 d, but when I converted the table 1 d I can't see the values and use separately from each other. For example, I simply multiply the first value of 1 thermocouple. How could I do that. In addition, the signals in the waveform table 1 is not smooth. What is the reason for this? Thanks in advance.
Hi James-D,
Thank you. Now, it is clear to me.
-
How to set the values of the columns WHO of the API
Hello
I want to run an API that will update and insert data of lats. I want to know how I can get below the values in columns
last_updated_by
created_by
last_update_login
According to documents https://docs.oracle.com/cd/E18727_01/doc.121/e12897/T302934T303920.htm then they should be TO_NUMBER (PROFILE FND_. VALUE ('USER_ID')), but these values return NULL from the back because I'm running database, not the application.
For last_update_date and creation_date I use SYSDATE.
APPRECIATE YOUR QUICK RESPONSE!
Thank you and best regards,
It has fnd_global.login_id, fnd_global.user_id (no need to to_number). But if you are in the back-end without connecting, there is no user. You can use the user 0 (sysadmin) or - 1 (anonymous). It makes sense that you would use that, since no matter which user you would use is actually not true right (that the user is not currently logged).
Or perhaps you can use a default user, like a WEBSERVICE_DEFAULT_USER or something to connect as this user before performing actions (using fnd_global.apps_initialize).
Maybe you are looking for
-
Satellite L650 (PSK1EA) new installation - how?
Hello my hard drive in the recently broken L650 (PSK1EA).I intend to buy a new one and replace only snag is that I never backed up my old one. I know I have to buy windows again, but what other things do I need.where can I get and when I install (bef
-
Problems with the battery / Satellite A100 - 151 (PSAA9)
Hello! My Toshiba laptop 3/4 years, has had problems with the battery. Battery does not charge properly and to start windows, the laptop down even when the battery is at 70%. Normal use without AC is not possible. The first 3 months, the laptop worke
-
How to recover the password for AirPort Extreme in ipad
How to recover the password for the ex airport in ipad
-
Pavillion 500-223w: startup problems
My hard drive crashed. (I presume). Operating system loss. Bought the new hard drive, and on starting with the recovery disk I get 6 beeps and no video. Unable to get to the bios. Have reinstalled everything after everything unplugged and powered up
-
Programmatically determine if the forcing is enabled on target in real time
A HMI application that I'm working, I want to inform the user at startup if the forcing is enabled on the target if all I/O's today obliged. This information is readily available in the Distributed System Manager, but I can't seem to find a way to g