How one table based on another table on average?
Example:
I have the ARRAY1 array with the following:
1
1
1
2
2
3
Array2 contains:
1
2
3
4
5
6
In the end, ARRAY3 would contain:
2 (1+2+3)/3
4.5 (4+5)/2
6 (6)/1
This is my first go at it. There are a lot of improvements that can be made (conditional index is one) but it seems to do what you want. Table 1 and 2 must be the same size to make it work.
Tags: NI Software
Similar Questions
-
Conditional display of one article based on another value of element
Hi all
I have an element (say 'objects') with a static list of values. Depending on the value selected in this article, I needed another element of selection list to display.
For example: 1st selection list item = items (Job, Name, ID)
2nd selection list item tool = list of values for the selected object (list of names if 'Name' is selected in the 1st item in the selection list)
So, for the 2nd selection list item should I create separate LOVs for each job, Name, ID?
How can I achieve this?
Please help me.
Thanks in advance
8f4692cc-040e-48EE-B102-590cdd4303fc wrote:
Please update your forum profile with a real handle instead of '8f4692cc-040e-48ee-b102-590cdd4303fc '.
I have an element (say 'objects') with a static list of values. Depending on the value selected in this article, I needed another element of selection list to display.
For example: 1st selection list item = items (Job, Name, ID)
2nd selection list item tool = list of values for the selected object (list of names if 'Name' is selected in the 1st item in the selection list)
So, for the 2nd selection list item should I create separate LOVs for each job, Name, ID?
How can I achieve this?
Use the built in support of the LOV cascading by converting static LOVs in dynamic LOVs based on SQL queries:
Question of LOV1:
select 'Job' lov_label, 'JOB' lov_value from dual union all select 'Name', 'NAME' from dual union all select 'ID', 'ID' from dual
Question of LOV2:
select name lov_label, name_pk lov_value from names where :LOV1 = 'NAME' union all select job, job_pk from jobs where :LOV1 = 'JOB' union all select id, id_pk from ids where :LOV1 = 'ID'
-
How to replace one table with another?
I need to replace one table with another. Both tables have the same structure, primary keys, indexes, constraints, but different data (about 50 million records).
I would like to make this replacement in line, with no passage of database in offline mode.
There is no clause CREATE or REPLACE TABLE in Oracle unfortunely.
I could use just DROP and ALTER TABLE RENAME instructions, but it is necessary that a user receive message error "table or view does not exist. It may be possible to block incoming requests at the moment, while old and new droppping table rename are performed?
Thanks in advance.Hi again!
You can detect normal users with session sessions $ v. A session of a normal user has a username (username of the column). Systemsessions PMON and SMON have no user name. So, you can use the following query to detect sessions, you need to kill:
SELECT sid, serial#, username FROM v$session WHERE type NOT LIKE 'BACKGROUND';
concerning
-
Hi people
How the identity if one table used only by synonyms and not by any other subprogrammes within a schema. I see in the TOAD describe objects tab used by, but I would like to identify hundreds of table so I would like to know if there would be any SQL or Meta Data Tables?
How the identity if one table used only by synonyms and not by any other subprogrammes within a schema. I see in the TOAD describe objects tab used by, but I would like to identify hundreds of table so I would like to know if there would be any SQL or Meta Data Tables?
The ALL_DEPENDENCIES view has hierarchical information based on object_id
The view object has the object_type.
Create a hierarchical query on the first view and attach it to the second view.
Or you can use the utldtree.sql file in the installation of the DB admin folder. Comments initially show you how a hierarchical query based on the object type.
-
Choose field from the joined table based on another field?
Hello!
Is it possible to select a field in a row of attached table based on another field? Consider the following data in the CVALUES table:
And the following data in the table MDETAIL:ID C1 C2 C3 C4 C5 C6 T1 9.6 10.3 12.4 19.6 19.6 0 T7 9.6 10.4 0 0 0 0 T3 8.2 9.9 11.4 19.6 19.6 0 T8 8.3 10.7 13.5 20.7 0 0 T5 9.4 10.3 12.7 22.9 19.6 0 ...
I want to get the column corresponding to the VALUE field in the table MDETAIL CVALUES. I'm doing this:ID MDATE CNUM ... T1 03/28/2012 18:00:00 4 T1 03/28/2012 18:00:00 1 T8 03/29/2012 06:00:00 6 T8 03/29/2012 06:00:00 5 ...
The CVALUES table records are unique; only one line by ID.SELECT m.t1, m.mdate, CASE WHEN m.cnum = 1 THEN c.c1 WHEN m.cnum = 2 THEN c.c2 WHEN m.cnum = 3 THEN c.c3 WHEN m.cnum = 4 THEN c.c4 WHEN m.cnum = 5 THEN c.c5 WHEN m.cnum = 6 THEN c.c6 END AS cvalue FROM mdetail m JOIN cvalues c ON m.id = c.id
This method works and it's fast, but it's messy code and I think there must be a better way to do it. I use cvalue value in several calculations so each calculation that I use is this giant glob of CASES inside!Hello
With a decoding it would be easier, but as ugly :-)
SELECT m.t1, m.mdate, DECODE( m.cnum , 1 , c.c1, 2, c.c2, 3, c.c3, 4, c.c4, 5, c,c5, 6, c,c6) cvalue FROM mdetail m, cvalues c WHERE m.id = c.id
Success!
FJFranken
-
Update of the table based on another
Hello
I'm trying to update a date column in a table based on another table. There is a unique ID in each table that identifies and connects each person:
This is the error:update patient_bu a set a.entry_date = (select b.entry_date from CLIENT_MED_DT b where a.id = b.id)
ORA-01427: einreihig subquery returns multiple rows
The problem (I think) is that the select statement back several dates for records people. There are some people / records that have multiple entry dates, but I'm only interested in the most recent date.
How can I update this table with only the most recent date?
Thanks for any help,
MattOh well, I forgot the UPDATE clause:
SQL> create table patient_bu 2 (id number 3 ,entry_date date); Table created. SQL> create table client_met_dt 2 (id number 3 ,entry_date date); Table created. SQL> merge into patient_bu a 2 using (select id 3 ,max(entry_date) max_date 4 from client_met_dt 5 group by id 6 ) b 7 on (a.id = b.id) 8 when matched then update 9 set a.entry_date = b.max_date; 0 rows merged.
-
Shutter button to copy records from one table to another; ORA-04091:
Hello
I am trying to create a trigger that will move data from one table to the other.
I have two tables (Trial1, Trial2) two of them contains the same attributes (code, c_index)
I want to spend each new record inserted in (code Trial1) (code in Trial2)
It's my trigger:
Create or replace trigger trg_move_to_trial2
After Insert on Trial1
for each rowStart
insert into Trial2 (code)
Select: new.code of Trial1;end;
He compiled, but when I insert a new record (the code) in (Trial1), it shows this error:
Error report:
I know matter what it means error, but I did not how to fix the error.
SQL error: ORA-04091: table STU101. TRIAL1 is changing, function of triggering/can not see
ORA-06512: at "STU101. TRG_MOVE_TO_TRIAL2', line 3
ORA-04088: error during execution of trigger ' STU101. TRG_MOVE_TO_TRIAL2'
04091 00000 - "table %s.%s is changing, function of triggering/can not see.
* Cause: A trigger (or plsql user-defined function that is referenced in)
This statement) attempted to watch (or modify) a table that has been
in the Middle being modified by the statement that shot.
* Action: Rewrite the trigger (or function) so it does not read this table.
..................................................................................................
I tried to change the (insert after on Trial1) before (insert on Trial1); It worked, but not in a good way. When I insert value in (code Trial1) new and refreshed Trial2 table, just as much as the records I have 2 test they will be duplicated. For example
Trial2
when I insert in Trial1
code
111
222
333
Trial1
code
444Trial2 will be:
can you please tell me how to fix this?
code
111
222
333
444
444
444
Kind regards
Published by: 1002059 on April 23, 2013 17:36You should not select Trial1 - you already have data. Simply insert this value.
Create or replace trigger trg_move_to_trial2 After insert on Trial1 for each row begin insert into Trial2 (code) values (:new.code); end;
Kind regards
David -
Add a simple table without one logical join to another table (OBIEE 10 g)
Sometimes I want to just show a simple table without a logical join to another table in the repository. However, every time I move the layer Business model and mapping and an audit of overall coherence, he tells me that he has a logical join and I am forced to create another table to join her. Creating a dimension-fact relationship. There are times where I need this relationship and I want to just display some data. Is anyway to circumvent this?
Thanks in advance!Yes, you must create a join. You can't take one table to MDB layer. You can create an alias for the table. Join this alias and the base through any common column table and take the two tables in MDB and table you want to the presentation layer.
Another way is to create a view in the physical layer. Write a select statement as
Select Table primary_key
Where primary_key is the primary key of the base table. Join the base table of view ith and repeat the steps defined for the Alias.
Kind regards
Sandeep -
best way to create a table based on another table
Hello
I am trying to create a table based on another table with all the data in it. It contains important data.
create table < tablename > select * from table1.
Is the best way to do it, or is there another way. Please advice.
Thank youInsert / * + append * / in
as select * from ; It should be->
insert /*+ append */ into
select * from ; Kind regards.
LOULOU.
-
Copy all the BLOBs from one table to another
Hi all
I hope that I put in the right place. I am trying to copy from one table to the other BLOBs, but were usuccessful. Here is the script that I wrote to do, but it just loaded a field saying not supported. Is there something I'm missing, I'm using the APEX 3.1.2.
Thanks for your help.
DECLARE
number of v_id;
v_document blob.
v_filename varchar2 (200);
v_mimetype varchar2 (200);
CURSOR c_Document IS
SELECT id, name of the document file, mimetype
IN v_id, v_document, v_filename, v_mimetype
OF CAB_APPEAL_ACTIONS
WHEN THE DOCUMENT IS NOT NULL;
BEGIN
FOR r_Document in c_Document
LOOP
INSERT INTO CAB_APPEAL_DOCUMENTS
(APPEAL_ACTION_ID,
DOCUMENT,
FILE NAME,
MIMETYPE
)
VALUES
(v_id,
v_document,
v_filename,
v_mimetype
);
END LOOP;
END;In addition, what is wrong with just...
INSERT INTO CAB_APPEAL_DOCUMENTS (APPEAL_ACTION_ID, DOCUMENT, FILENAME, MIMETYPE) SELECT id, document, filename, mimetype FROM CAB_APPEAL_ACTIONS WHERE DOCUMENT IS NOT NULL;
APEX will end process page in a BEGIN block... END; block anyway.
See you soon
Ben
-
Copy from one table to another
Is there a simple way to copy/add all the records from one table to a master table?INSERT INTO master_table (Field1, Field2, field3)
SELECT field1, Field2, field3
From other_table
WHERE everything whatIf the data types, order and the column names are the same for both tables, then it would also work to copy all other_table lines in master_table:
INSERT INTO master_table
SELECT *.
From other_tablePhil
-
How to get the print page numbers in a report based on another report
Hello
I have a requirement in which I need to print the page based on another report number
example my game application has 3 reports
1 report prints the pages 1-100
Report page no. 2 should start from 101 to 110
3 report 111-
Can someone make me please how to do this?
THX in advance
KumarHello
You can create all report queries three in a single report, create a separate query in the data model and then create the layout in the proper sequence as required.
If you want to use separate reports only you can try the following:
In the first report, use the shutter release after report and record the total number of pages of a table as a record.
In the second report, extract the value stored in the table and add it to the Page No. to get the Page number for the second report.
Also in the second report use the shutter release after report and update the record created first in the total number of pages + total number of pages of the first report.In the third report to extract the value stored in the table and add it to the Page No. to get the Page number for the third report.
Don't forget to delete the folder created in the trigger after the third report table report.I hope this helps.
Best regards
Arif Khadas
-
I have a large amount of CD I put together in WaveBurner on an internal drive which is full. I know there is an import button to import audio files.
But I want not just audio files, but all projects, so I can still work on them.
How better to import everything from WaveBurner a reader to one empty WaveBurner on another drive?
I thank very you much for your time and patience.
Since no one answered my call, I sat and researched and studied WaveBurner behavior and I can myself answer my question and solve. Since there were a lot of people asking similar questions on WaveBurner files I will post what I learned.
Whenever you drop your audio files in the list window to make your WaveBurner CD copy not copy your audio files, but relies on the original audio file, where they are located. So whenever you move the files orig. and you open WaveBurner, it can't find those and displays an error window to suggest it will search for the missing file or if you know where he is now lets you find manually. WaveBurner usually place the .wb3 project file that contains everything including your home folder.
For this reason, I reserve now an audio file WaveBurner also folder in my home folder. In order to save themselves from WaveBurner cannot find the audio file, all audio files that I do, I put in my folder of audio files WaveBurner first, then copy them in WaveBurner from there.
When I need to use a bigger hard drive I copy .wb3-WaveBurner projects based, but also my
Sound folder WaveBurner for the home folder on the new hard drive.
WaveBurner is now all audio files without problem.
I hope that this will be a unique problem to someone else. Happy WaveBurning.
W.W.
-
Hi all
Problem: Build a VI to display a string in the table of the lights. Each letter must be posted in a separate table and letters must move from one table to the other in the direction from left to right.
I did program mentioned above but it does not work. Can you tell me what is the problem?
There is no error is indicated in the program. If someone knows about it please try to find solutions and help me out of this problem.
I have attached my program with this message.
Thank you in advance!
(1) FOR loops are your friend here. You can make a slight restructuring using loops, and then you will have less mess to deal with, the inner loop through tunnels of autoindexing to make it even simpler.
(2) I would only treat the numeric values of the characters. So go terminal of control of the chain, the capital letters and byte array to before the outer loop. You can use a size of Board over there to tell how many times the outer loop to iterate.
(3) the Index table is extensible. So you only need over the index of the first, and it will increment itself, as it develops.
(4) you need to finish the lookup table (table 3D)
-
Hi Please help me how to use cascade, if I don't have only one table with the customer name and the name of the product in the ADF... I use Jdeveloper 11.1.
For the client, I used customer VO with client list to fill but to populate the product that I use bind variable PrODUCT_NAME select distinct from TABLE where client_name =: bindCustomer
so first of all, I need to set the variable of liaison on behalf of the selected customer.
Can you please tell me how to set this variable binding in this case.
After you set the LOV to your product attribute, correspondting VO in the LOV will appear under view accessors.
Change the accessor of the view, you will see the variable binding. Set its value to the customer field of the parent object.
Visit this link: https://www.youtube.com/watch?v=nXwL2_RP7AQ
Kind regards
Elias.
Maybe you are looking for
-
Installation of SSD drive and the noise of the fan to the MacBook Pro?
Hello Just replaced the stock 5400 RPM HARD drive in my MacBook Pro mid-2012 with an SSD 480 GB Sandisk and now the fan makes a loud noise. Sounds like it's revving at full speed. Does anyone know how to fix this? Thank you.
-
Impossible to share the internet connection on the mac pro with the 5s iPhone book
Hi, I use Internet on my mac pro book using ethernet I try to connect to internet on my iPhone 5 s using internet sharing. When I try to connect my iPhone using wifi it shows that there is an authentication failure Please help me solve the problem Th
-
! HelloSince the last update of hp my system does not work smoothly. And t! HE hp support Assistant also does not work. I tried to reinstall hpsa but it did not work.Then I tried to reset the system and he said: "the problem occurred during reset", o
-
Activation of vista does not work
Hello This is not the first time, I had the problem. I recently updated my mac and install a new copy of vista. For my old computer, actually due buy two copies of vista because after days phone with microsoft, I'm sick of it. Now I'm getting the sam
-
Failed to save to the Services CUVC-5110-HD10 - SIP
I'm after disconnect issue with Adhoc TelePresence calls - after approximately nine and a half minutes I get an abnormal disconnect error MSG and the calls must be reset. The call is made on my end and it happened yesterday in two different places.