Leaving aside the second records when a join is successful...
HelloI built a stored procedure that takes 3 parameters:
-Start date (to_date (December 18, 2008 "," dd-MM-yyyy ""))
-End date (to_date (December 15, 2008 ',' dd-MM-yyyy ""))
-User name (sysur_auto_key = 100)
This corresponds to the request at the bottom of this post (the parameters are hardcoded).
The query takes each part of 30 minutes between the start and end date and joins EXTERNAL, related records.
This is data that I am currently getting with the query below. As you can see there are two rows with START_DATE 16/12/2008 12:00.
I would select 1 only one record per START_DATE. If the join cannot be made there is always 1 plug. When the join is possible however a second row is selected with the corresponding joint field. I want to only select the line where the SYSUR_AUTO_KEY is null when the join CAN be made... Is this possible?
TO_CHAR(START_TIME,'DD-MM-YYYYHH24:MI') STOP_TIME SYSUR_AUTO_KEY
--------------------------------------- ------------------------- ----------------------
16-12-2008 08:00 16-12-08
16-12-2008 08:30 16-12-08
16-12-2008 09:00 16-12-08
16-12-2008 09:30 16-12-08
16-12-2008 10:00 16-12-08
16-12-2008 10:30 16-12-08
16-12-2008 11:00 16-12-08
16-12-2008 11:30 16-12-08
16-12-2008 12:00 16-12-08
16-12-2008 12:00 16-12-08 100
16-12-2008 12:30 16-12-08
16-12-2008 13:00 16-12-08
16-12-2008 13:30 16-12-08
16-12-2008 14:00 16-12-08
16-12-2008 14:30 16-12-08
16-12-2008 15:00 16-12-08
16-12-2008 15:30 16-12-08
17-12-2008 08:00 17-12-08
17-12-2008 08:30 17-12-08
17-12-2008 09:00 17-12-08
17-12-2008 09:30 17-12-08
17-12-2008 10:00 17-12-08
17-12-2008 10:30 17-12-08
17-12-2008 11:00 17-12-08
17-12-2008 11:30 17-12-08
17-12-2008 12:00 17-12-08
17-12-2008 12:30 17-12-08
17-12-2008 13:00 17-12-08
17-12-2008 13:30 17-12-08
17-12-2008 14:00 17-12-08
17-12-2008 14:30 17-12-08
17-12-2008 15:00 17-12-08
17-12-2008 15:30 17-12-08
The querySee post further on for directly runnable example
Published by: user574699 on December 2, 2008 06:12
It looks like a use of the function analytic lag for me.
Basically, we ignore all values where the offset is not null, indicating that the previous line was of real value
with
MONTHS as
(select TO_DATE('15-12-2008', 'dd-MM-yyyy') + ((ROWNUM-1) / (24*2)) as DT
from DUAL
connect by ROWNUM <= ((TO_DATE('17-12-2008', 'dd-MM-yyyy') - TO_DATE('15-12-2008', 'dd-MM-yyyy')) * 24*2) + 1),
TIMES as
(select DT as START_TIME,(DT + 1/48) as STOP_TIME
from MONTHS
where TO_NUMBER(TO_CHAR(DT,'HH24')) between 8 and 15
and TO_NUMBER(TO_CHAR(DT,'D')) not in (1,7)
),
EP_PLAN_R as (
select
249243 EPPR_AUTO_KEY,
4 WOK_AUTO_KEY,
to_date('16-12-08 13:00', 'dd-MM-yy HH24:MI') NEED_DATE
from
DUAL
union all
select
249244 EPPR_AUTO_KEY,
4 WOK_AUTO_KEY,
to_date('16-12-08 13:00', 'dd-MM-yy HH24:MI') NEED_DATE
from
DUAL
),
EP_PLAN_R_M as (
select
249243 EPPR_AUTO_KEY,
100 SYSUR_AUTO_KEY
from
DUAL
)
select start_time,stop_time,sysur_auto_key from
(
select start_time,stop_time,sysur_auto_key,
lag(sysur_auto_key,1,null) over (partition by start_time order by start_time asc) thelag from
(
select
TO_CHAR(START_TIME, 'dd-MM-yyyy HH24:MI') START_TIME,
TO_CHAR(STOP_TIME, 'dd-MM-yyyy HH24:MI') STOP_TIME,
EPRM.SYSUR_AUTO_KEY
from
TIMES left outer join EP_PLAN_R EPR on START_TIME = EPR.NEED_DATE
left outer join EP_PLAN_R_M EPRM on EPR.EPPR_AUTO_KEY = EPRM.EPPR_AUTO_KEY
where EPRM.SYSUR_AUTO_KEY = 100 or EPRM.SYSUR_AUTO_KEY is null
group by START_TIME, STOP_TIME, SYSUR_AUTO_KEY
order by START_TIME ASC
))
where thelag is null
;
Tags: Database
Similar Questions
-
All the music Burns fine on the cd, but for some reason, simply of turns black towards the end of the program, leaving aside the last pictures of the film. I need help!
You may add too many files on the CD.
And a project too complex can cause problems...
too many transitions, effects, splitting, etc...And... It may be useful if you are going to... Tools / Options /.
... Compatibility tab and left click to restore all
Default button.One or more files also may have compatibility
questions:Several formats are apparently compatible with
Movie Maker, but the most reliable choices are:Photos - bmp
Video - wmv or dv - avi
Audio - wav, wma, wmvTry to save the project in the. WMV video format
in a folder on your hard drive and then burn the
. File WMV to CD using other software.To save in a .wmv movie file...
Type of... CTRL + P (or go to...) File / save movie file)
to open the wizard movie recording.
Choose... My computer.
Next /.
Enter a name and a location.
Next /.
ICT... "Best quality for my computer.
Next /.
Wait while the movie is saved.
Finishing...See the following article:
Movie Maker - video recording on a CD - R, CD - RW.
http://www.windowsmoviemakers.NET/tutorials/HowToSaveCDRom.aspxThe free software CDBurnerXP allows you to burn your video
file on a data CD.CDBurnerXP
http://CDBurnerXP.se/
(Yes, it works on XP, Vista, 7)CDBurnerXP - create data disc
http://CDBurnerXP.se/help/data/compiledataAnd... If you decide to create a video DVD... the
following freeware can be worth a try:(FWIW) It's always a good idea to create a system
Restore point before installing software or updates)DVD Flick
http://www.Digital-Digest.com/software/download.php?sid=1246&SSID=0&did=2
(the download is: "dvdflick_setup_1.3.0.7.exe")Save the file to your desktop or a folder on your
hard drive and install from there.Be sure to read the Guide:
http://www.dvdflick.NET/Guide.phpTutorials:
Tutorial DVD Flick
http://beginwithsoftware.com/videoguides/DVD-flick-Guide.htmlBurn any Format video DVD PC
http://www.freevideoworkshop.com/dvdflicktutorial.htmAVI to DVD with DVD Flick Guide
http://www.Digital-Digest.com/articles/AVI_to_DVD_using_DVD_Flick_page1.htmlTo create a video DVD base that should play in a free
permanent drive DVD... try the following...First... read the DVD Flick Guide to familiarize
with the program.Open DVD Flick and insert a blank DVD in your drive.
If the window of Autorun from your computer... just close it.
Click the project settings button and check... Video /.
Target format... residents United States... Choose... NTSC /.
Accept.The title button left click Add and navigate to your
Video clips and select the ones you want on the DVD.You can have by selecting one and then use
the up and down buttons.Left click on the button create DVD / OK / Yes / Yes.
Please wait while the DVD is created.
When the text "Completed successfully" is displayed you
DVD Flick can close. Now you can eject your DVD
and play in your DVD player.At some point you might want to buy more
Advanced Cyberlink, Nero, Roxio, software
Ulead, etc... but at least it is a start.Good luck.
-
Original title: restore the follow-up case
am usind windows vista and I found the track record, when I deleted it I lost all my videos folder, and when I checked in the Recycle Bin that they were not there.is there a way to restore?
Hello
Once removed the HDD data can't be recovered. However, you can use your favorite search engine to browse third-party data recovery software and use this software to recover data.Note: Using third-party software, including hardware drivers can cause serious problems that may prevent your computer from starting properly. Microsoft cannot guarantee that problems resulting from the use of third-party software can be solved. Software using third party is at your own risk.
You can also view the following link to recover lost or deleted files and try the steps:
http://Windows.Microsoft.com/en-us/Windows-Vista/recover-lost-or-deleted-files
-
How to display a message on the second tab when an option is selected in a drop-down
Hello
I use a combo of my title bar, to within my application to display a list of options that will trigger different URL webViews.
On my first tab I have a Web of a page view and when the option is selected the webView will change and the second tab will load the same webView but with /deals at the end of the url.
The problem I have is that one of the options does not have a page of /deals on their site so I was wondering if it would be possible to hide the second tab or display a message on the second tab, when this specific option is selected?
Thanks in advance
If your problem is what method to use to hide the tabs or what...
You can use these functions... It will remove the tab but will not destroy the content, it's like hiding and showing a tab
REMOVE / HIDE
tabbedPane.remove (theTab);
ADD / VIEW
var index = 2; the tab index
tabbedPane.insert (index, theTab);
-
Alert to be fired only for the first record, when there are duplicate entries
Hello
This is related to the fact of Oracle 10 g.
I have a block record multi in which I entered and save some codes, something like below
Code Description
=====================
AAAAAAAAAAAA ABCD
BBBBBBBBBBBBB PQRS
GENEVIEVE DAVIS
ABCD DHGFKSDHKSHG
PQRS DFJHHGS
EEEE SDT85604ET
=====================
Now I need to post a warning/msg to go when-validate-the field Code. So now if I'm on the first record, the alert/msg will appear for code ABCD which is Ok. Now, on the next album, I get a different code PQRS as indicated above, the new alert appears which is Ok. If I enter a code that has been previously entered into the record block multi and alert/msg had been exposed to the only first alert/msg need is not displayed now know if I enter ABCD again the fourth record, the alert should not be displayed.
Note that this must be done at the time of data entry itself. I guess that maybe it can be done by using groups Records / table plsql.
Help with a way to solve this matter will be highly appreciated...
Thank you and best regards...As you have already guessed, you must be able to keep track of how many times a value has been entered. If you know what all the possible values of 'CODE' at design time, you can create a counter for each value variable, but it would be a total pain. A better solution would be to permanently keep a total dynamics you can quickly check against. For this I recommend you use a group of registration of forms. Take a look at the demo of Forms - record group treatment (duplicate values check) I wrote. Using the packet of forms Rec_Group condition in this demo, you can easily change the process listed in the working document in your scenario. Follow all the steps in the demo. For your situation, you must change the when-validate-Item trigger so that instead of checking the dupicates and omitting the form if a duplicate is found, you check the number of entries to a value in the record group and display a message if the number is 0 or not to display a message if the number is greater than 0. Your modified WVI trigger might look like this:
DECLARE ignore NUMBER := 0; bignore BOOLEAN := FALSE; BEGIN IF ( :YOUR_BLOCK.CODE IS NOT NULL ) THEN ignore := Rec_Group.Get_Number(Rec_Group.rg_name, :YOUR_BLOCK.CODE); IF ( ignore = 0 ) THEN -- Display your message ELSE -- Don't display any message END IF; /* add the code to the record group */ bIgnore := Rec_Group.Add_Value(rec_group.rg_name, :YOUR_BLOCK.CODE, :system.trigger_record); END IF; END;
Hope this helps,
Craig B-)If someone useful or appropriate, please mark accordingly.
Published by: Silvere March 30, 2011 15:07
-
Make the midi recording when the track is not selected
Hi, asking for my friend and will try and find a solution when I get home, but...
My friend (using logic 9.1.8) made some record with about 12 actors/singers alive. I suggested to him that he must save the midi for keyboard player (who is also the composer of all parts) as well as the audio just to give them some flexibility later. It is a great keyboard player and uses its own external keyboard. (i.e. not logic instrument). All the other singers/actors are all audio.
So it is easy to implement but as such sessions can become a little hectic and although the midi for keyboard track is in record mode, the midi does not record unless the track is selected on the left. Sometimes, in the madness of him the entire midi track remains not selected and if the midi data does not get saved. Is it possible to routing in the environment where the midi will get recorded although the midi track is not selected? Don't forget, the midi track is always made armed.
Thank you very much
Looks like you entered only followed for the targeted track has allowed...
This picture isn't in X 9 - but it's the same setting...
Make sure that this is not the case-
-
remove the second record of strings
Hi all
I have the table emp with the id and name columns.
EMP
name identity
--------------------
100A
100a < -.
101 B
102 C
102 c <.
102 C
now I want to delete duplicate lines second of each group of duplicate rows.Can be
The OP wants to delete 2nd record ;)create table test2 as select 100 col1, 'A' col2 from dual union all select 100, 'A' from dual union all select 101, 'B' from dual union all select 102, 'C' from dual union all select 102, 'C' from dual union all select 102 ,'C' from dual delete from test2 t2 where rowid in(select rowid from( select col1,col2,row_number()over(partition by col1 order by col2) rn from test2) where rn=2) 2 rows deleted select * from test2 COL1 COL 100 A 101 B 102 C 102 C
-
View the results of the second request when I hover over a field in a report
Hello
I have a table 'ASSETS', which, among other things, an ASSET_ID and a NAME column. It is possible that an asset will be alias so I have a second table, ALIAS, which has a FK to ASSETS. ASSET_ID and a column ALIAS.
I have a report on the PROPERTY table that includes the NAME. I wish I could have the user to move the mouse over the name and have a popup (like the ' title' that you can set in the attributes 'link' to a column in a report) appear that contains all aliases the ALIASES for this ASSET_ID table.
Is this possible and, if so, can you point me in the right direction?
Thank you
JosephHello
OK - I think you need to do something like the following:
1. create a function that returns a VARCHAR2 value. This must concatenate the alias into a single string (you can include a blowdry form layout if you use the SPAN method to view the data instead of the setting of the "title" attribute).
2. on the column that you want to apply it, you must build the content of the cell by using the parameter Expression HTML - in there, you can use #COLUMNAME # no matter wherever you need
Andy
-
Hello
I am developing a new model form left on the GREEN, GLOBE, PSAV, JA, I, JL, e.t.c.. PLL that are globalization and vertical markets. Because they are attached to the APPCORE.pll I copy it and lift out them the shape (I mean the APPCORE.pll). The problem is that as soon as I save this file APPCORE.pll (in a local disk) attachments are attached... once again.
How can I let them...? They are attached to the other .pll so...?
Note: I use EBS 11.5.10.2
p.s.: Not a prosperous and enjoyable year...!
Thank you very much
SIMSIM,
Not sure if I understand you correctly, but if you want to open TEMPLATE.fmb form, you must copy certain forms and libraries on your local machine. These files are listed in the following note (topic How can you confirm the version of the FMX or FMB file?).
Note: 177610.1 - Oracle Forms in Applications FAQ
https://metalink2.Oracle.com/MetaLink/PLSQL/ml2_documents.showDocument?p_database_id=not&P_ID=177610.1 -
Trying to update a table in a second table when the data are different
Hello;
I have a the same table in two databases. The database are connected with a DB link. I'm trying to update one table based on the data in the second table when the EMP_ID is but the name does not match.
The table will look like:
Table name: EMP
EMP_ID
LAST_NAME
FIRST NAME
MIDDLE_INITIAL
My SQL is:
This refers to a number of update of all lines not the bit I want.update EMP TARGET set (TARGET.LAST_NAME, TARGET.FIRST_NAME,TARGET.MIDDLE_INITIAL) = ( select SOURCE.LAST_NAME, SOURCE.FIRST_NAME, SOURCE.MIDDLE_INITIAL from EMP@OTHER_DB SOURCE where TARGET.PHYSICIAN_ID = SOURCE.PHYSICIAN_ID and TARGET.LAST_NAME <> SOURCE.LAST_NAME);
Any help would be great!Hello
Sky13 wrote:
Hello;
I have a the same table in two databases. The database are connected with a DB link. I'm trying to update one table based on the data in the second table when the EMP_ID matchDo you doctor_id?
but the name does not match.
The table will look like:
Table name: EMP
EMP_ID
LAST_NAME
FIRST NAME
MIDDLE_INITIALMy SQL is:
update EMP TARGET set (TARGET.LAST_NAME, TARGET.FIRST_NAME,TARGET.MIDDLE_INITIAL) = ( select SOURCE.LAST_NAME, SOURCE.FIRST_NAME, SOURCE.MIDDLE_INITIAL from EMP@OTHER_DB SOURCE where TARGET.PHYSICIAN_ID = SOURCE.PHYSICIAN_ID and TARGET.LAST_NAME <> SOURCE.LAST_NAME);
This refers to a number of update of all lines not the bit I want.
Any help would be great!
There is no WHERE clause in the UPDATE statement, so that each row in the target table will be changed.
If you only want to change the lines that have a match in the source table, then add a WHERE clause (perhaps "WHERE EXISTS (...)) with a subquery miuch very similar to the one you already have), or use the MERGER instead of UPDATE.If you want to know, post CREATE TABLE and INSERT statements to recreate the tables they existed before the UPDATE and also post the contents of the table changed after the UPDATE.
Always tell what version of Oracle you are using.Maybe you want something like this:
{code}
MERGE INTO the emp target
WITH THE HELP OF)
SELECT o.emp_id
o.last_name
o.last_name
o.middle_initial
OF emp@other_db o
JOIN emp t ON o.emp_id = t.emp_id
AND o.last_name! = t.last_name
) source
WE (target.emp_id = source.emp_id
WHEN MATCHED THEN UPDATE
SET target.last_name = source.last_name
target.first_name = source.first_name,
target.middle_initial = source.middle_initial,
;
{code}
assuming that emp is unique, at least in other_db.It will work in Oracle 10 (and more). In Oracle 9, MERGER still requires a WHEN MATCHED clause, so add one if you must. No matter what he does; the subquery USE will only return matches.
Published by: Frank Kulash, October 10, 2011 16:45
-
SeaMonkey Mail: When I type a paragraph of text in an e-mail message, send it to myself.
and read it, I find that SeaMonkey merges occasionally words together leaving aside the space.
The original text has spaces, but the received text is not. I am using 2.14.1 and were
only for the last month or so to have this problem. At around the same time, I noticed
only SeaMonkey started underlying parts of the words in red. This happens when I go back
to correct a misspelled word. If these problems are linked and how to fix? I must
reloading SeaMonkey? The same thing happens when I run it in safe mode without addons.This is the Firefox support forum. Help with SeaMonkey, try asking in the forum MozillaZine SeaMonkey support, here:
-
I configured a single partial tile, leaving aside the day before virtual machine and the virtual Microsoft Exchange computer.
I had a successful run from start to finish on this tile.
I then re-directed the harness again (note, between the virtual machines have been turned off so I could clone them to start doing additional tiles).
The second time, I started the harness, and it stops at the VMmark installation phase:
-Could not Ping the following machines: OlioDB0
Since the first customer, I ping OlioDB0 and got a successful response
The command would be "staf OlioDB0 ping ping" from a windows command prompt.
You can look in the Manager of tasks for STAFproc.exe.
If this is not the case, you can connect to your DS2DB0 via ssh and run the following two commands: (note the time and space)
. /usr/local/STAF/STAFEnv.sh
/ usr/local/SCOTT/bin/STAFProc
-
AJVOAF: Current record is missing during the passage to the next record
Dear friends,
Area of the table, I have 3 LOVs - hardware, Subinventory and Locator (I did Subinventory and Locator LOVs ReadOnly... According to requirement)
When lov material is clicked, it displays equipment, subventory and locator. (After extension of material VO)
I managed to bring this subinventory to READ ONLY Subinventory field by default, when physical lov is clicked (the requirement)
For the first time when I click on material lov, iam getting subinventory name in 'READ ONLY Subinventory field' by default. OK fine. But for the second time when iam doing the same (by clicking on material lov), as usual, iam getting name subinventory in READING ONLY Subinventory field by default... BUT the first record above subinventory is have disappeared.
For the third time when iam done the same (by clicking lov), the second disc of subinventory material is have disappeared. For the fourth time when iam done the same (by clicking lov), the third record in subinventory material is have disappeared. If iam now able to see only the fourth record only no first, second, third they r have disappeared. How to solve it.
And when you click the Add button in the region of table LINES show the error as "LINE 1 MATERIAL - SELECT A VALID VALUE"
Help, please. Help, please.
Let me know for any clarification
Thank youHi Christophe,
You can have three maps already for the material scope Lov lov
1 material Lov map
2 subInventory Lov map
3 locator map LovAdd lov-plus two cards in the material field Lov as below
1. Add two value form fields for subinventory & locator separately, namely SubinventoryFrmVal & LocatorFrmVal.
2. give the same attribute as subinventory & locator for the value of both form fields.
3. Add lov map of field material that form values also. It will keep the values in the field read-only.You already have two cards as below:
Add the below two like so:
It worked for me... Try and let me know.
--
Florence -
update with the duplicate record
I'm working on my update page and I came across the problem where it allows to update the duplicate record. My code works for the second time when I tried to update the same name.
For example, I have the user name A, B and C of the database.
For the first time: update the username from B to A. This allowed me to do so given the A user name already in the table. (NOT RIGHT)
Second step: update the C to A user name. He stopped me because of the duplicate record
NOT QUITE RIGHT, IT SHOULD BE STOPPED ME FIRST?
Thank you
You should probably change the first query if a line with the same id is not considered:
Select user_name
users
where trim (user_name) = ' #trim (form.user_name) #
and user_id! = #user_id #.
If all the rows are returned from get_dupecheck then you don't want to do the update.
-
Where is the sound recorder small application and notes on Z2?
any of you have an idea where it is?
I've got my xperia Z this apps but on Z2, I do not find
@dm841
Can u download the apks of notes and the second recorder?
I don't have them either..402 TW version
Update: ok, found the note, here u go guys
http://docs.Google.com/file/d/0B2ONZFOkl3m7bUh0RVF5MjBETDQ/edit
Install it as a regular application.
Maybe you are looking for
-
El Capitan calendar gray weekends?!
I saw some other request it work with no responses. Finally, I upgraded from ML to EC and the only complain I have is that weekends are greyed out on the calendar, making you not notice them. Many of us work weekends and these are just as importan
-
Cannot set the URL to the new tab from windows 10 update?
With windows 7 I had edited the subject: config so that when open a new tab it always open a page of google. Since I updated to windows 10 it now only shows top sites, even if the subject: the configuration file shows that he has set to open google.
-
HI, I have my 5 systems put in place on my account. Two of them are old PC now retired. They weren't my apple account deauthorised. How can I remove them? Thank you in anticipation Steve.
-
Office Jet Pro 8500 won' t scan
Help. My Office Jet Pro 8500 scan is no longer. I click on the printer icon and select scan. It seems to be analyzed. But there is no sign of an item scanned on my desktop which is where I selected the item scanned go. I have a Macbook Air with
-
I can't access a program that I downloaded on a disk has received with a camcorder called Image Browser Ex Version 1.2.1. He charges to 80% and then hangs until finally I receive a mnessage 'failed to load correctly. Check that Silverlight is insta