How to divide the lines based on two columns...
Hi all...I have a requirement.
I have the product, sale, purchase price column... (total of three columns) in a data set.
my data set is in such a way that... If the sale price is... There is no purchase price and vice versa...
I need too present in a report, two tables:
Table 1 includes only the elements of retail price
Table 2 should only contain the right elements.
Please see the below photo for good understanding...
Is this feasible? Where do we need to impose a condition? I tried to impose a condition, but it doesn't seem to work
http://i51.Tinypic.com/29xfdc6.jpg
Help, please.
Can you send me the xml file and the model of [email protected]? I can try to help.
Have you tried to filter the records by the sale or purchase price is not equal to null column price?
Thank you
Bipuser
Tags: Business Intelligence
Similar Questions
-
Numbering of the lines based on two columns
Hello world
I´d would like to know if there is a way to achieve the numbering shown in the second table below indicating only Oracle native functions, like ROW_COUNT() on the partition, etc.
I m using Oracle 10 g.
The logic used is:
From 1, increment one each time that the ORIGIN is identical to the FIRST ORIGIN of the line (ID) group.
In order to compare the ORIGIN of each line with the FIRST ORIGIN of the group, I used the function LAG to create a column that will be the FIRST ORIGIN of the value in the group.ID ORIGIN DESTINATION ORDER ------------------------------------ 1 A B 1 1 B A 2 1 A B 3 1 B C 4 1 C A 5 ID ORIGIN DESTINATION ORDER NUMBERING -------------------------------------------------- 1 A B 1 1 1 B A 2 1 1 A B 3 2 1 B C 4 2 1 C A 5 2
However, I was not able to number the lines as shown above (column NUMBERING).
Any help will be much appreciated.
--------------------------------------------------------------------------------------------------------------
Test query:WITH T AS ( SELECT 1 ID, 'A' ORIGIN, 'B' DESTINATION, 1 ORDERING FROM DUAL UNION ALL SELECT 1 ID, 'B' ORIGIN, 'A' DESTINATION, 2 ORDERING FROM DUAL UNION ALL SELECT 1 ID, 'A' ORIGIN, 'B' DESTINATION, 3 ORDERING FROM DUAL UNION ALL SELECT 1 ID, 'B' ORIGIN, 'C' DESTINATION, 4 ORDERING FROM DUAL UNION ALL SELECT 1 ID, 'C' ORIGIN, 'A' DESTINATION, 5 ORDERING FROM DUAL ) SELECT T.ID , T.ORIGIN , T.DESTINATION , T.ORDERING , LAG (T.ORIGIN, T.ORDERING -1, 0) OVER (PARTITION BY T.ID ORDER BY T.ID , T.ORDERING) FIRST_ORIGIN_OF_GROUP FROM T ORDER BY T.ID , T.ORDERING
Hello
Here's one way:
WITH got_first_origin AS ( SELECT id, origin, destination, ordering , FIRST_VALUE (origin) OVER ( PARTITION BY id ORDER BY ordering ) AS first_origin FROM t ) SELECT id, origin, destination, ordering , COUNT ( CASE WHEN origin = first_origin THEN 1 END ) OVER ( PARTITION BY id ORDER BY ordering ) AS numbering FROM got_first_origin ;
This assumes that the combination of id and order is unique. Within an id, you place your order does not have to be consecutive integers, or something like that.
Analytical functions cannot be nested (the argument of the function of COUNTY anlytic can not call the analytical FIRST_VALUE function); The subquery is necessary.
You could do something with a LAG, as you have tried, rather than FIRST_VALUE, but you would still need a subquery, for the same reason. -
How to divide the C: drive into two partitions without a third-party program?
Hello
Is there a way to divide the C: drive into two partitions C: and D: on Windows XP without a third pary program?
If anyone has an idea, please give some steps.
Thank you.
Assem
Hey Assem,
Once you have created a primary partition, it is not possible (for Windows XP) to divide the partition without using third-party software. You can see:http://support.microsoft.com/kb/309000 to create a new partition.
I hope this helps...
-
How to divide the Panel layer in two?
How do divide you the layers panel in half? I've seen references to do this but Googling this question does not work.
I use CS2
Far as I can tell that the person referred to the screenshot of the layers panel appeared in the article, not the real layers panel in Photoshop.
-
Single line based on two columns and a single column
Dear members,
I have a table that contains duplicate rows, for which a request should be able to extract the unique row in the table. Here the unique is not based on a single column, but it should be in two columns and also check on the uniqueness on a column.
create table addr (varchar2 (10) firstname, lastname varchar2 (10), area varchar2 (3));
insert into values addr ('bob', 'james', 1');
insert into values addr ('bob', 'james', 1');
insert into values addr ('harry', 'bert', ' 1');
insert into values addr ('jimmy', 'bert', ' 1');
insert into values addr ('sam', 'mac', '1');
insert into values addr ('sam', 'Knight', '1');
insert into values addr ('tom', 'sand', '1');
insert into values addr ("cat", "mud", "1");
The query output must contain 3 lines.
Bob - james
Harry - bert or jimmy - bert [or the other of them], but not both
-Mac or sam - Sam Knight [or the other of them], but not both
Tom - sand
Cat - mud
SELECT firstname, lastname as total area WHERE addr = '1' GROUP by firstname, lastname; It takes no duplication of single column...
Any suggestions...SQL> with t_data as ( select 'bob' as firstname, 'james' as lastname, '1' as area from dual union all select 'bob', 'james', '1' from dual union all select 'harry', 'bert', '1' from dual union all select 'jimmy', 'bert', '1' from dual union all select 'sam', 'mac', '1' from dual union all select 'sam', 'knight', '1' from dual union all select 'tom', 'sand', '1' from dual union all select 'cat', 'mud', '1' from dual ) SELECT firstname, lastname, area FROM ( SELECT t.*, row_number() over(partition BY firstname order by 1) rn, row_number() over(partition BY lastname order by 1) rn1 FROM t_data t ) WHERE rn = 1 AND rn1 =1 ; FIRSTNAME LASTNAME AREA --------------- --------------- ---------- bob james 1 cat mud 1 jimmy bert 1 sam knight 1 tom sand 1 SQL>
-
How to upgrade the lines based on multiple Conditions
Hello
I create a table Ename, Empno and sex as the columns. In my table of 100 records are there. Some records having sex "Male" and others are "female". How can I update all records if sex is "Male", then it will be updated as 'Female' vice versa. How to achieve this requirement? /
--
Thank you and best regards,
Badr Hari
One way:
UPDATE my_table
SET sex = DECODE (kind, ' Male ',' female ', 'female ', ' male', gender);
-
Hello
Actually I got to know this update of a record must be made when the primary key is based on two columns.
Previously, I used SPEL for a column. It was working fine.
But I came to know that regardless of the folder I try to update, it was the update page is coming up with the first combination of the record.
As if RC 131
RC 124
RC 125 are the records.
If I click on update of RC 124 also, the update page is coming up with RC 131 values as it is the first.
So I understand that the SPEL should be based on two parameters, because it is a composite key.
How to do?
Please let me know if you don't understand the problem.
Thank you.
Wow!
I got it.
Thank you brothers, always a hope that you could help me
-
Divide the line into several columns
Hi all
I have a question where I want to divide the line into multiple columns based on the delimiter ' |'.
Staging of Table structure: People_STG, I have people in it.
Create table People_STG(col1 varchar2(4000));
Insert into People_STG(Emp_id|) User name | FirstName. LastName. JobTitle | hire_date | Location_id)
SELECT REGEXP_SUBSTR ( COL1, '[^,|]+', 1, 1) EMP_ID, REGEXP_SUBSTR ( COL1, '[^|]+', 1, 2) USERNAME, REGEXP_SUBSTR ( COL1, '[^,|]+', 1, 3) FIRSTNAME, REGEXP_SUBSTR ( COL1, '[^,|]+', 1, 4) LASTNAME, REGEXP_SUBSTR ( COL1, '[^,|]+', 1, 5) JOBTITLE, REGEXP_SUBSTR ( COL1, '[^,|]+', 1, 6) HIRE_DATE, REGEXP_SUBSTR ( COL1, '[^,|]+', 1, 7) LOCATION_ID FROM PEOPLE_STG WHERE length(regexp_replace(COL1, '[^|]', '')) = 14;
But I am facing a problem here, as in some lines, function is null, but when I run the above query, it is not recognizing the empty element and inserting Hire_date values of function and location_id in Hire_date where function is null.
for example: 1 | akash51 | Akaksh | C | 22/11/14 | 15
Here the function is null, so when I run top to divide query it will insert 11/22/14 in the function column and 15 in Hire_Date.
Please need help on this one.
Oracle Version: 11.2 g
Thanks in advance,
Akash.
There are different techniques to cope with this. Is a simple...
SQL > ed
A written file afiedt.buf1 with t as (select 1 | akash51 |) Akaksh | C | 22/11/14 | 15' as col1 of union double all the
2 Select 2 | akash52 | Akaksh | C | Jobs jobs | 23/11/14 | 15' of the double
3 )
4 --
5. end of test data
6 --
7 select trim (REGEXP_SUBSTR (COL1, ' [^, |] +', 1, 1)) EMP_ID,.
8 toppings (REGEXP_SUBSTR (COL1, ' [^, |] +', 1, 2)) USERNAME,.
9 garnish (REGEXP_SUBSTR (COL1, ' [^, |] +' 1, 3)) FIRSTNAME,
10 pads (REGEXP_SUBSTR (COL1, ' [^, |] +' 1, 4)) LASTNAME,.
11 garnish (REGEXP_SUBSTR (COL1, ' [^, |] +' 1, 5)) JOBTITLE,.
12 pads (REGEXP_SUBSTR (COL1, ' [^, |] +', 1, 6)) HIRE_DATE,.
13 garnish (REGEXP_SUBSTR (COL1, ' [^, |] +' 1, 7)) location_id
14 * from (select replace (col1, ' |)) ',' | as col1 of t)
SQL > /.EMP_ID USERNAME FIRSTNAME LASTNAME, JOBTITLE HIRE_DATE LOCATION_I
---------- ---------- ---------- ---------- ---------- ---------- ----------
1 akash51 Akaksh C 22/11/14 15
2 akash52 Akaksh C Job 23/11/14 15 -
How to draw the line under STROKE and fill of an object in illustrator cc? Any ideas ...
Aleksandar,
If I (put) understand it, you will need to divide the object. You can:
(1) select the object and Ctrl / Cmd + C + F, and then remove the filling of the copy and the blow of the original;
Draw 2) and drag the new piece down between Division 1 objects) in the layers palette, or select 1 copy) and Ctrl / Cmd + C + F + X + F or similar.
-
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 find the ANGLE b/w two edges in Oracle Spatial
How to find the ANGLE b/w two edges on Oracle Spatial. I have two edge connected on the same node. I wanted to know the angle betwwn them. Can someone help me?Ok. My first example is an approximation. Further you get North or South of the Ecuador, gets the more vague.
This one should do the trick with some degree of precision.declare PI constant number := 3.14159265358979; g1 sdo_geometry; g2 sdo_geometry; g3 sdo_geometry; angle1 number; angle2 number; FUNCTION POINT(P_LAT IN number ,P_LONG IN number) RETURN MDSYS.SDO_GEOMETRY IS BEGIN -- we load both the ordinate array and the point type because some spatial functions show inconsistent behavior -- it is not important for this example, just something to be aware of return(mdsys.sdo_geometry(2001,8307 -- WGS84 ,mdsys.sdo_point_type(p_long,p_lat,null) ,mdsys.sdo_elem_info_array(1,2,1) ,mdsys.sdo_ordinate_array(p_long,p_lat))); END; begin -- For the example, project in WGS84 -- g1,g2,g3 could also come straight out of the database as sdo_geometry g1 := point(50, 7); -- Point A g2 := point(51, 7); -- Point B g3 := point(50,10); -- Point C angle1 := atan2(g2.sdo_point.x - g1.sdo_point.x, g2.sdo_point.y - g1.sdo_point.y); angle2 := atan2(g3.sdo_point.x - g1.sdo_point.x, g3.sdo_point.y - g1.sdo_point.y); -- depending on rotation and where we are on the planet, adjustments may be needed if angle1 < 0 then angle1 := angle1 + 2 * PI; end if; if angle2 < 0 then angle2 := angle2 + 2 * PI; end if; if angle2 < angle1 then angle2 := angle2 + 2 * PI; end if; dbms_output.put_line('Angle between the lines A-B and A-C: '|| round(sdo_util.convert_unit(angle2-angle1,'Radian','Degree'),1)); end;
Angle between the lines A-B and A-C: 90
-
How to choose the line PFI to use on the port of the 5761?
I understand that the VIDEO that I use on my DAC 5761 allows me to access 8 PFI lines. However, when I access my 5761 devices in the project window by clicking the "+" next to the name of the module, I see that 'PFI Input' and ' output PFI. I tried to get this to send a signal in the past, but I have been unable to determine how to select the line PFI I want to use. How can I select the PFI line?
Any ideas? I was able to get the my AWG PFI (5422) for work and it is amazing. I want to order an attenuator digital step for a ground penetration radar that I develop.
Your time and your help is very appreciated.
PS: I have worked with this PXI system (chassis, embedded controller, FPGA digitizer 5761 and AWG) for 1 year and I am afraid that it is time to learn this one way or another.
Good day!
-Daniel
I found the solution. In addistion to the node which is visible in my previous post, there must be a node to enable PFI write with an entry of decimal number indicating the line is activated. Then, there must be a node PFI active connector, set to true. Not sure if the node of the latter is really necessary, however. Otherwise above examples should work as is.
-
How to add the full value of two buttons?
How to add the full value of two buttons (any key) VI and display it in the output text box? I am attaching a sample program, but I know that his evil... Help, please
Try this
-
SQL query * I want to insert a file column in the other table based on two columns
I want to insert a column records to another table based on two columns
the query below does not work
insert into def_ver_lnki_p (job_name)
Select def_job.job_name
from def_job where def_job.job_id = def_ver_lnki_p.job_id and def_job.table_id = def_ver_lnki_p.table_id;
Just to correct sql
Update
def_ver_lnki_p define job_name =)
Select def_job.job_name
of def_job
where def_job.job_id = def_ver_lnki_p.job_id
(and def_job.table_id = def_ver_lnki_p.table_id);
-
Hi all...
Here, I use the following scripts...
create table a10 (eno number, date f, date t, number of sal)
INSERT IN A10 (ENO, F, T, SAL) VALUES)
1, TO_Date (1 July 2013 12:00:00 AM ',' DD/MM/YYYY HH: mi: SS AM'), TO_Date (June 30, 2014 12:00 ',' DD/MM/YYYY HH: mi: SS AM')
(100);
INSERT IN A10 (ENO, F, T, SAL) VALUES)
1, TO_Date (May 1, 2013 12:00:00 AM ',' DD/MM/YYYY HH: mi: SS AM'), TO_Date (April 30, 2014 12:00 ',' DD/MM/YYYY HH: mi: SS AM')
(200);
COMMIT;
entry:
ENO F T SAL
07/01/2013 2014/06/30 100 1
1 05/01/2013 30/04/2014 200
Expected results:
ENO F T SAL 1 05/01/2013 2013/06/30 200
1 30/04/2014 300 07/01/2013
1 05/01/2014 2014/06/30 100
I'm little bit confused how to divide the dates here... Any help is appreciated.
Thank you all
Stéphane
Hello
Always tell what version of Oracle you are using, especially if it's so old.
In Oracle 10 (or 9, by the way) you can do this way:
WITH cntr AS
(
SELECT LEVEL AS n
OF the double
CONNECT BY LEVEL<=>=>
)
got_change_date AS
(
SELECT d.eno
C.n
WHEN 1 THEN f
ANOTHER t + 1
END AS change_date
C.n
WHEN 1 THEN 1
OF ANOTHER-1
END as mul
sal
BY a10 d
CROSS JOIN cntr c
-WHERE... - If you need any filtering, put it here
)
got_total_sal AS
(
SELECT eno
change_date f
Advance (change_date) OVER (PARTITION BY eno
ORDER BY change_date
) - 1 AS t
SUM (sal * mul) over (PARTITION BY eno
ORDER BY change_date
) AS total_sal
OF got_change_date
)
SELECT *.
OF got_total_sal
WHERE t IS NOT NULL
ORDER BY eno, f
;
Maybe you are looking for
-
Satellite L500: What to do with the recovery system for 64-bit disk?
Hello Is could someone please tell me what I can do after the recovery of the product process.I did a recovery support 1, system and recovery media 2 repair disk Windows 7 64-bit much earlier when I bought the laptop.But where do I put these files th
-
Hello I have my attempt at creating uisng Excel report. "(I tried with the code smaple works not very well, but when I try to add in my project its giving an error"error excel2000.h"(7333,66): expected ' ')', What could be the issue,", what could be
-
Action engine config fails (always worked before?)
I used a driving force to write and read many applications config files. For some reason, now my config refnum is bad when I switch to a new action. The refnum goes wrong after going through the shift register. I probe it and the number seems fine
-
Is to reinstall windows and reformatting the same windows? How can I reformat windows? TQ.
-
My errased sticker product key and I can't read all the text to reactivate my windows visa. What should I do now?