Who join use in the situation below?
HelloI have 2 tables with structures like below
Table:-Machine
(machinename char (5),
MachineId char (6),
date StartTime,
end date,
quantity)
Table:-stop
MachineId char (6),
date of shutdowntime,
shutdownmins char (5)
What I want to do, is change machine starting and endtimes table according to the table to stop stops.
Basically I will be leading table having structures like the machine table with just the difference in time of start and end according to the cases.
Means that I will have a query select selection of fields that from the machine table table stop but will only be used for the calculations of time change.
I am little confused here what join to use or have any other way to solve this problem.
I need select only query response.
Experts help me!
Thank you
Mahesh
>
So basically I will not need to select any since the closure just for the calculation
>
Well, which makes no sense.
The only way that you can use "shutdown" calculation is to choose in this one.
That's what Salomon showing you; How to select the data that you need it and do the math.
Tags: Database
Similar Questions
-
Necessary request for the situation below.
Hi all
I have two table
T1-> deal_site_id, subsection_id
T2-> deal_site_id, subsection_id, catalog_id
requirement is first of all that I have to check all the subsection_id of the T1 table based on a deal_site_id.
So subsection_id what ever I get from table T1 I have to check if those that are available in table T2. If they are available, then do nothing, but if they are not available in table T2, then delete the row in the table T1.
I tried to write the query as below but stuck with the exception.
DELETE FROM (SELECT * FROM T1 join T2 ld lid inner)
COVER ON. DEAL_SITE_ID = LD. DEAL_SITE_ID
WHERE lid.deal_site_id = 3070
AND LD. SUBSECTION_ID NOT IN (SELECT DISTINCT liod.subsection_id liod T1 where liod.deal_site_id = 3070)
);
This gives me an exception as ORA-01752: cannot delete the view without exactly a key preserved table
Please help me to write this query. Thanks in advance.
Kind regards
Delphine
Published by: sumajumd on February 2, 2012 03:08Hi, Ludo,.
It looks like:
DELETE FROM t1 WHERE deal_site_id = 3070 -- or whatever AND subsection_id NOT IN ( SELECT subsection_id FROM t2 WHERE deal_site_id = t1.deal_site_id AND subsection_id IS NOT NULL -- If necessary ) ;
I hope that answers your question.
If not, post a small example of data (CREATE TABLE and only relevant columns, INSERT statements) for all of the tables involved and the results desired from these data.
In the case of a DML operation (for example, REMOVE) the sample data should show what look like the paintings before the DML, and results will be the content of the or the tables changed after the DML.
Explain, using specific examples, how you get these results from these data.
Always tell what version of Oracle you are using. -
Unable to explain more clearly, I hope you understand my question
For details of how to proceed, see section 'Changing download actions' of this link - https://support.mozilla.com/kb/Managing+file+types
-
Original title: the remote keyboard language
Hello
I connect to a remote virtual desktop. My local computer uses a different keyboard language than the remote.
I want that my users who connect to the virtual remote control to use the one I have set myself in this picture and not their local since keyboard only supports us that we provide in the virtual, not on their local machine.
I've tried the "Reg" IgnoreRemoteKeyboardLayout key, but I've been the opposite. Who closes?
Is their a way to force the RDP to use the remote keyboard and not local?
Thank you
Hello
Thanks for posting your query in Microsoft Community.
I understand you have questions using the remote keyboard on the Windows computer. So, please follow the link below to post your query in the Technet forums, because they have more expertise on this issue.
TechNet forums
http://social.technet.Microsoft.com/forums/Windows/en-us/home?Forum=w7itpronetworking
I hope this helps.
Thank you
-
He had to know the right outer join using...
He had to know the right outer join using...
For example: first query left outer join for the emp table: SELECT EMPNO, ENAME, D.DEPTNO FROM EMP E, Department D WHERE the E.DEPTNO = D.DEPTNO)
Second query left outer join for the Dept table: SELECT EMPNO, ENAME, D.DEPTNO FROM EMP E, Department D WHERE the D.DEPTNO = E.DEPTNO)
In the example above I just Exchange where condition condition to get an outer join of two table with a left outer join itself. Wat is use right outer join, instead, I can swap the status of table name for the result. Please suggest...
Hello
chan001 wrote:
He had to know the right outer join using...
For example: first query left outer join for the emp table: SELECT EMPNO, ENAME, D.DEPTNO FROM EMP E, Department D WHERE the E.DEPTNO = D.DEPTNO)
Second query left outer join for the Dept table: SELECT EMPNO, ENAME, D.DEPTNO FROM EMP E, Department D WHERE the D.DEPTNO = E.DEPTNO)
In the example above I just Exchange where condition condition to get an outer join of two table with a left outer join itself. Wat is use right outer join, instead, I can swap the status of table name for the result. Please suggest...
The two examples above use the old syntax outer join of Oracle. (I guess there should be a sign inside the parentheses, e.g.. +)
... WHERE E.DEPTNO = D.DEPTNO (+)
)
The LEFT OUTER JOIN and RIGHT OUTER JOIN terms apply only to the ANSI join syntax, e. g.
.
.. FROM EMP E
DEPT LEFT OUTER JOIN D ON E.DEPTNO = D.DEPTNO
As Blushadow said above, there's no real point in having LEFT OUTER JOIN and RIGHT OUTER JOIN; What you can do with one (or a combination of both) can be done with the other. Most people use LEFT OUTER JOIN systematically and never use RIGHT OUTER JOIN.
There are situations where using a combination of the two would mean a little less striking, but only a little less and this kind of situation is very common, and one may wonder if the somewhat shorter code is more specific. I suggest that forget you RIGHT OUTER JOIN.
-
And anyone who has used the creative cloud cleaner to help with installation problems? I should try?
Hi Alison,.
You do not specify the issue that you are facing, but you can restore Photoshop CC 2014.Please use the link below to find out how to install an older version of any Application Adobe CC.
How to find and install a previous Version of Adobe Apps in CC 2015 | Adobe Customer Care Team
Link to adobe vacuum as you said use the Adobe Creative Cloud cleaning tool to solve installation problems
Cloud troubleshooting creative risks troubleshoot Adobe Creative Cloud download and installation issues
Let us know if that helps you solve/Rolling back Photoshop.
~ Assani
-
Creating a view using multiple joins - by reducing the number of output lines
It is difficult to put into words exactly what I want to implement, so I'll just use an example. Let's say I have the following database:
game (id, time, place)
Reader (game_id, name)
Referee (game_id, name)
Foreign keys:
Player (game_id) references game (id)
Referee (game_id) references game (id)
It is a very special match, in which:
A game can have 1 to many players
A game can have from 1 to several arbitrators
I want to create the following view:
Game_overview (Game_id, time, player, referee)
It's easy to create this view with the following output:
Game1, 15:00, player1, Referee1
Game1, 15:00, player1, Referee2
Game1, 15:00, player2, Referee1
Game1, 15:00, player2, Referee2
Game1, 15:00, Joueur3, null
08:00, player1, Referee1, GaMe2
GaMe2, 08:00, player1, Referee2
HOWEVER, I want it to look like this:
Game1, 15:00, player1, Referee1
Game1, 15:00, player2, Referee2
Game1, 15:00, Joueur3, null
08:00, player1, Referee1, GaMe2
GaMe2, 08:00, null, Referee2
I think that this should not be TOO difficult to solve, but I can't really get my head around it.Welcome to the forum!
Whenever you have a problem, please post CREATE TABLE and INSERT statements for your sample data. Sinve it's your first post, I'll do it for you:
CREATE TABLE game ( id VARCHAR2 (10) PRIMARY KEY , time VARCHAR2 (10) --, location VARCHAR2 (10) -- No need to include columns that play no role in this problem ); INSERT INTO game (id, time) VALUES ('Game 1', '3PM'); INSERT INTO game (id, time) VALUES ('Game 2', '8AM'); CREATE TABLE player ( game_id VARCHAR2 (10) , name VARCHAR2 (10) ); INSERT INTO player (game_id, name) VALUES ('Game 1', 'Player 1'); INSERT INTO player (game_id, name) VALUES ('Game 1', 'Player 2'); INSERT INTO player (game_id, name) VALUES ('Game 1', 'Player 3'); INSERT INTO player (game_id, name) VALUES ('Game 2', 'Player 1'); CREATE TABLE referee ( game_id VARCHAR2 (10) , name VARCHAR2 (10) ); INSERT INTO referee (game_id, name) VALUES ('Game 1', 'Referee 1'); INSERT INTO referee (game_id, name) VALUES ('Game 1', 'Referee 2'); INSERT INTO referee (game_id, name) VALUES ('Game 2', 'Referee 1'); INSERT INTO referee (game_id, name) VALUES ('Game 2', 'Referee 2');
In this way, people who want to help you can recreate the problem and test their ideas.
In addition, to say what version of Oracle you are using. The following query will work in Oracle 9.1 or more.
What you asked is what I call a Query, fixed-price , and this is a way to do it:
WITH player_plus AS ( SELECT game_id , name , ROW_NUMBER () OVER ( PARTITION BY game_id ORDER BY name ) AS r_num FROM player ) , referee_plus AS ( SELECT game_id , name , ROW_NUMBER () OVER ( PARTITION BY game_id ORDER BY name ) AS r_num FROM referee ) SELECT g.id , g.time , p.name AS player_name , r.name AS referee_name FROM player_plus p FULL OUTER JOIN referee_plus r ON p.game_id = r.game_id AND p.r_num = r.r_num JOIN game g ON g.id = COALESCE (p.game_id, r.game_id) ORDER BY g.id , COALESCE (p.r_num, r.r_num) ;
Output:
ID TIME PLAYER_NAM REFEREE_NA ---------- ---------- ---------- ---------- Game 1 3PM Player 1 Referee 1 Game 1 3PM Player 2 Referee 2 Game 1 3PM Player 3 Game 2 8AM Player 1 Referee 1 Game 2 8AM Referee 2
I see that you have more arbitrators than players in a game. If such was not the case, then you might make it a bit more efficient using a LEFT OUTER JOIN between p and r, rather than a FULL OUTER JOIN, and you can also use only the columns of p where I use COALESCE.
Published by: Frank Kulash, March 9, 2012 18:15
Fixed spelling -
I have adapters and converter of power for international travel. I was told by someone who often visits that the converter is not necessary for apple products. I don't want to ruin my phone or watch - can I use my power converter?
If you use the Apple adapter supplied, you will simply need an adapter to use in other countries. The adapter can be used with voltages between 100-240 v AC 50-60 Hz
-
I have a new time capsule airport. How to limit the search for who can use the time capsule backup process?
Set a password to disk... disk tab in the utility... and just give to those you want to use the TC...
-
Original title: the status message appears on the start page.
Message that appears at startup to the top: the component you are trying to use is on a network containing the installation package "status.msi" in the box below. Click OK to try again or enter a different path to the folder containing the installation package "status.msi" in the box below.
Hello
Have a few questions that might help me to analyze the cause of the issue you're having with your computer.
· When you get the message that says, "Status.msi file missing?
· You have an installed HP printer?
· You made any hardware or software changes the computer recently?
Method 1:
You can try to clean boot and check if you still get the error message.
How to troubleshoot a problem by performing a clean boot in Windows Vista or in Windows 7
http://support.Microsoft.com/kb/929135
Note: After troubleshooting, be sure to set the computer to start as usual as mentioned in step 7 in the article.
Method 2:
If the problem persists, you can try to restore the system on your computer and check if it helps.
http://Windows.Microsoft.com/en-us/Windows-Vista/what-is-system-restore
Hope this helps
-
It is difficult to read the address bar in Explorer. How can I increase the size of the address bar? When I use the zoom tools icon it only increased the size of the screen below.
You talk about the size of the text of the elements of windows.
But the question was about the SIZE OF the INTERNET EXPLORER ADDRESS BAR SIZE.
It is very difficult to use the address bar now when it 12-15% of the width of the IE.
To change the TI: right - click on the bar next to the tabs. the drop - down menu select "show tabs on a separate line.
That's what concerned, imho.
-
I'm trying to uninstall SKYPE but I am stuck because the system administrator does not allow me. Who is the system administrator? If its me, how can I correct the situation?
Hello
If you forget the administrator password, and you do not have a password reset disk or another administrator account, you will not be able to reset the password. If there is no other user account on the computer, you will not be able to connect to Windows and you will need to re - install Windows.
What to do if you forget your Windows password:
http://Windows.Microsoft.com/en-us/Windows7/what-to-do-if-you-forget-your-Windows-password
Microsoft's strategy concerning lost or forgotten passwords:
-
Original title:
warning by email
Got this e-mail with the subject attention!
Is - is this legitimate?
He wants me to press any key to continue
Thank you
Microsoft account Microsoft Security info We discovered the series of illegal attempts on your e-mail account of different areas of the intellectual property.It's for your own safety to continue to use your account, click on the button below.Continue Note: Please do not ignore this email to avoid your closed account Thank you The team Microsoft account Hello
Phishing scam.
Ignore!FYI
Microsoft usually has a green shield on the name of the sender.
This indicates that the e-mail coming from Microsoft / play the sender.
If, in case of doubt, please check your email to see if the Green Shield is there. ***
Phishing: Frequently asked questions
How can I Report Spam, Phishing or abusive messages in Outlook.com? -
Tuning for sql join key table no consumer of the heavy use of the query processor
Obligation comes to tunne prod of the query in
high use of the query processor
sql_id: fp79wb32h7a6t
Module: AHC, P_PatientDQ()
Cost: 7
Elapsed time: hung
Status: Hung, 35,253,460 day at 30 minute intervals
-Create table
create table ahc. PATIENTVISITS
(
ahcid NUMBER,
visitId NUMBER,
visitstatus NVARCHAR2 (100),
visitdate DATE,
visitintime DATE,
visitouttime DATE
)
-Create/recreate the index
create indexes ahc. F1_PATIENTVISIT_AHCID on ahc. PATIENTVISITS (AHCID, VISITID);
create indexes ahc. VISITDATE_IDX on ahc. PATIENTVISITS (TRUNC (VISITDATE));
First total number of table
Select count (1) of
Pvs AHC.patientvisits
-Save County 1387485
create table ahc. PATIENTDEPENDENTVISITS
(
ahcid NUMBER (19) not null,
IDPack NUMBER (10) not null,
visitId NUMBER (19) not null,
dependentvisitid NUMBER (19) not null,
isdiabetic NUMBER (2)
)
-Create/recreate the index
create indexes ahc. K1_PATIENTDEPENDENT_AHCID on ahc. PATIENTDEPENDENTVISITS (AHCID);
Total number of second table
Select count (1) of
AHC.patientdependentvisits POS
-Save County 774599
Original request:
SELECT count (*)
ACH. PVS PATIENTVISITS
WHERE PVS. VISITID IN (SELECT POS. DEPENDENTVISITID
ACH. PATIENTDEPENDENTVISITS POS
WHERE POS. AHCID = 37
AND POS. VISITID = 218
AND POS. ISDIABETIC = 0)
AND SUPERIOR (PVS. VISITSTATUS) = 'PENDING'
AND PVS. AHCID = 37
Count (1)
-----------
1
PL/sql Developer explain plan for the original query
Owner of description Objects_name cost cardin bytes cpucost cost of e/s
SELECT STATEMENT, GOAL = ALL_ROWS 7 1 41 63669 7 AGGREGATION OF TRI 1 41 SEMI OF THE NESTED LOOPS 7 1 41 63669 7 TABLE ACCESS BY INDEX ROWID AHC PATIENTVISITS 4 1 25 33295 4 INDEX RANGE SCAN AHC F1_PATIENTVISIT_AHCID 3 9 23164 3 TABLE ACCESS BY INDEX ROWID AHC PATIENTDEPENDENTVISITS 3 1 16 30375 3 INDEX RANGE SCAN AHC K1_PATIENTDEPENDENT_AHCID 2 14 18093 2 After editing the query
SELECT / * + FIRST_ROWS * / COUNT (1)
ACH. PVS PATIENTVISITS
JOIN THE AHC. PATIENTDEPENDENTVISITS POS ON PVS. VISITID = POS. DEPENDENTVISITID
WHERE PVS. AHCID = POS. AHCID
AND POS. AHCID = 37
AND POS. VISITID = 218
AND POS. ISDIABETIC = 0
AND SUPERIOR (PVS. VISITSTATUS) = 'PENDING'
Count (1)
-----------
1
PL/sql Developer explain plan for change request
Owner of description Objects_name cost cardin bytes cpucost cost of e/s
SELECT STATEMENT, TARGET = TIP: FIRST_ROWS 7 1 41 59257 7 AGGREGATION OF TRI 1 41 NESTED LOOPS NESTED LOOPS 7 1 41 59257 7 TABLE ACCESS BY INDEX ROWID AHC PATIENTDEPENDENTVISITS 4 1 16 36646 4 INDEX RANGE SCAN AHC K1_PATIENTDEPENDENT_AHCID 3 14 24364 3 INDEX RANGE SCAN AHC F1_PATIENTVISIT_AHCID 2 1 15293 2 TABLE ACCESS BY INDEX ROWID AHC PATIENTVISITS 3 1 25 22611 3 here after I changed the query no display cost = 7 io wait = improvement also 7 can someone please help these
How to adjust or rewrite lots of join not keys to multiple records on table table
Thank you
VSM
you have not answered my question. Are you really calling it 35 million times in 30 minutes?
If so, why?
-
When you buy an extended image lisence adobe stock can I use it as the back ground for a mail announcing who will be on the first page of my business profitable online store?
Adobe Stock license allows you to use your assets anywhere in the world, and the license never expires. You can use the assets, in print, presentations, Web sites and even on social media sites. However, you may not distribute digital assets by posting it online or in any other way that would leave other people to use the assets without permission it is.
from there:
Maybe you are looking for
-
This question has probably asked a thousand times, but I really need a preview. I have this application called SysSecInfo, it is a security application that has been removed from the app store some time ago. My phone started acting recently so I down
-
The vertical bar is one of the best features of Firefox, but because I use a netbook I sometimes need to close in order to show the complete Web page. The latest version of the browser had a 'view' drop-down list in which we could click and restore t
-
Hello I would like to ask for help with the possibility of correction of brightness for ThinkPad W510. I want to put in place the brightness using Fn + key one (from level 0 to 15), but it is not possible to do. Down is correction of brightness goes
-
break the barrier of the 137 in xp
I want to break the barrier of the 137 in xp! I have a 320 GB drive that uses only 137 GB on drive c and the rest on another drive! How can I get all the GB on my c drive!