SQL query problem - (internal has not managed to the outer query)
Hi all:Here is my SQL query:
SELECT RD.SITE,
ROUND(
(SELECT COUNT (DISTINCT PB.EMP_ID)
FROM BOOK PB
WHERE PB.EMP_ID IN
(SELECT PB.EMP_ID FROM BOOK PB
)
) /
(SELECT COUNT (DISTINCT PB.EMP_ID)
FROM BOOK PB
WHERE PB.EMP_ID IN
(SELECT PB.EMP_ID FROM BOOK PB
WHERE MO.QUALIFIER > 4
)
)* 100, 2) AS PERCENTAGE
FROM BOOK PB
LEFT JOIN POSITION MO
ON PB.EMP_ID = PO.EMP_ID
INNER JOIN PHYS_LOCATION RD
ON MO.HOUSED = RD.SITE_ID
WHERE MO.ACTUAL_END IS NULL
GROUP BY RD.SITE;
Why am I the overall percentage of all Sites as opposed to each percentage calculation for each site. I've grouped by Rd. SITE, so I assume he would calculate the percentages for each site. What I've done wrong?Thank you for your help.
AquaNX4 wrote:
Hi all:Here is my SQL query:
SELECT RD.SITE, ROUND( (SELECT COUNT (DISTINCT PB.EMP_ID) FROM BOOK PB WHERE PB.EMP_ID IN (SELECT PB.EMP_ID FROM BOOK PB ) ) / (SELECT COUNT (DISTINCT PB.EMP_ID) FROM BOOK PB WHERE PB.EMP_ID IN (SELECT PB.EMP_ID FROM BOOK PB WHERE MO.QUALIFIER > 4 ) )* 100, 2) AS PERCENTAGE FROM BOOK PB LEFT JOIN POSITION MO ON PB.EMP_ID = PO.EMP_ID INNER JOIN PHYS_LOCATION RD ON MO.HOUSED = RD.SITE_ID WHERE MO.ACTUAL_END IS NULL GROUP BY RD.SITE;
Why am I the overall percentage of all Sites as opposed to each percentage calculation for each site. I've grouped by Rd. SITE, so I assume he would calculate the percentages for each site. What I've done wrong?
It's what you're asking. Your subquery scalar to get the percentage is not restricted by the current site. Add columns to filter to restrict the values selected for the calculation
Published by: riedelme on May 8, 2013 07:26
Tags: Database
Similar Questions
-
When I press on trying to download photoshop cc at 42%, it is said that he has not managed to download every time I try to download
Orbital ZiLe for more information on how to resolve errors download please see error download and installation of the creative cloud application.
-
Hello, I recently restored my windows hp tower to its factory because of virus settings and when I restarted my PC I recieced this error message: Windows has not start because the following file is missing or corrupt: \system32\hal.dll
Please reinstall a copy of the above file. where can I get a copy? and is it possible to download the start software and burn it to a cd? Hi FRANKGRIMES_945,
What is the model of your computer?
(a) you can try to arrange for a Windows XP disk that corresponds to the same edition, as it is installed on your machine.
(b) thereafter, follow this link & check if you are able to start correctly on the desktop.
Hope the helps of information.
Please post back and we do know. -
Currently, I have Windows 7 and had to buy Windows 8 for the school. I tried downloading it several times, but when she writes the check, it is said, "Download unsuccessful. The download task has not completed. The new attempt at repair by block limit has been exceeded. The file is corrupted. »
I don't know what to do.
Original title: download Windows 8 Windows 7
Hello Travis,
Thanks for posting your question on the Forums of community of Microsoft.
To better understand the issue please help us with these questions.
from which site you try to download Windows 8?
b. what browser do you use to download?
c. you try to download a full version or update?
d. you run the upgrade wizard before trying to download the Windows 8?
This problem usually occurs due to the installation of Web the contents of the folder in the system. So, now, I you suggest to rename or delete the installation folder to the following location and then try to download Windows 8:
C:\Users\
\AppData\Local\Microsoft\Web install See also the link mentioned to follow the correct steps before and during the installation of Windows 8 below:
How to upgrade to Windows 8Note: I strongly recommend to back up all your important files and folders on an external storage device before performing any type of upgrade of the OS.
Hope this information is useful. If the problem still persists, please post back for further assistance, we will be happy to help you.
-
Audio has not transferred in the chronology of the sequence first CC 2014 of the source window. Video, appears on my calendar, but my stop audio added on my calendar. I had no problems in previous projects. I'm new to the Prime Minister, so if it is a question of rookie.
Thank you
Dave
Source Patch A2 on the left and uncheck the A1. See the red square. Targeting of the track as if it were now is used to do.
Learn all about source patch and track targeting.
Adobe Premiere Pro help. Source patch and the targeting of the track
-
ORA-13754: 'SQL Tuning Set' 'string' does not exist for the user "sysman."
ORA-13754: 'SQL Tuning Set' 'string' does not exist for the user "sysman."
Hello
in 10g R2 when I run the following in isqlplus I error of the United Nations:
No problem if I run it as sys to sqlplus.SELECT * FROM TABLE(DBMS_SQLTUNE.SELECT_SQLSET( 'my_sql_tuning_set', '(disk_reads/buffer_gets) >= 0.05')); ORA-13754: "SQL Tuning Set"'my_sql_tuning_set" does not exist for user "sysman".
Thanks for the help.
How to activate for sys isqlplus?You are logged in as sysman,
Check the user from the sql prompt.
show user
-
Old games has not transferred to the new device
Games on the old iphone and iPad has not transferred to the new iPhone and new ipad. Games show in Game Center, but didn't open at all or open to basic, start over.
dlb104 wrote:
Games on the old iphone and iPad has not transferred to the new iPhone and new ipad. Games show in Game Center, but didn't open at all or open to basic, start over.
Transfer the contents of an iPhone, iPad or iPod touch to a new device - Apple Support
-
We have made a purchase of the gems on the Cammand of Star Wars app. Although us have been billed double and no has not yet obtained the gems. Please help.
Contact iTunes supports http://www.apple.com/emea/support/itunes/contact.html for assistance.
-
Hello
in our society, we have an old domain controller has been disconnected for more than 200 days, probably in a State of thumbstone, it still appears in our network. We wanted to know what is the best way of disused this server, we connect to our network and do normal downgrade process.
How do you decommssion a domain controller that has not been on the network of more than 200 days?
Could you please write me back to my work email or call me on my work phone? Job information are below.
Hello
The business support, you can find forums on TechNet, see the following links:
http://social.technet.Microsoft.com/forums/en/category/WindowsServer/
-
I moved a listener on a host in a House different oracle. The headset works fine, but EM 12 c shows that the listener is down with the following summary:The listener is down: even if a listener with the name "AUDITOR", is running on this host at the port: "1521", it has not started using "the target LISTENER. ORA file. CORRECTIVE ACTION: To monitor this "EM listener target" with its current configuration, you must stop the process of listening running and start it using the Listener parameter file: opt/oracle/product/12.1.0.2/network/admin/listener.ora. Alternatively, you can update "this target LISTENER. Location ORA setting"with the location of the listener running, which started using the: opt/oracle/product/11.2.0.3/network/admin/listener.ora.
EM 11 g, I simply changed the configuration of the listener for the different oracle home, argued the change and in a few minutes the listener would show that 'UP' with the oracle of new home. I upgraded to MS 12 c (12.1.0.4) and can't find how to do this. Can someone give me the procedure.
Thank you
Ron
Hi Ron,
Can you please do the following?
-Create a for the listener listener.ora file, stop and start the receiver using the listener.ora file. If the file is located in a default location, set the TNS_ADMIN environment variable to that location before you start the listener.
-Log on to the EM console, go to the homepage of the listener.
-In the Oracle Listener menu, select target Configuration > Configuration of the analysis.
-Ensure that the parameters, including the Listener.ora directory, are properly.
Kind regards
-Loc
-
I paid at the rate of CC of Photoshop "the photographer", but Photoshop has not appeared on the computer! I don't see him! Where to look and how to download? Please, help me
Hello
Please visit https://helpx.adobe.com/creative-cloud/help/download-install-app.html
It will be useful.
Kind regards
Shelly
-
If only the balance changed in the clips, you can use copy and paste attributes.
If other settings have changed, you cannot use Paste attributes like these settings will also change
-
I installed creative cloud but it has not installed all the products and when I try to install Photoshop or Lightroom nor install it simply places another version of creative cloud.exe into my list of downloads
You try to install from the Web or Adobe Creative Cloud application?
If you had installed the Adobe Creative Cloud desktop application, launch it and connect.
Once logged in, click on the tab menu Apps.
After loading the list of apps apps, Photoshop and Lightroom and click Install next to him.
Location of the Adobe Creative cloud: C: > program (x 86) > Adobe > Adobe Creative Cloud > VAC > creative cloud.
For more details, see the 2 links above mentioned in the previous post
-
I write in the topic, I have created a form and in some of their fields, I used a SQL query to get information from a table based on the user who has been logging.
The information displayed well, but when I press "Send button" loses information and the field in the table is shown empty.
Anyone know what is happening?
I enclose below a picture of the problem
Concerning
Hi ANTHONY,.
ANTHONY wrote:
I give you the credentials of my database, I hope you could do it works and most importantly, showing me what the error care...
Feel free to change what you want in the application
https://Apex.Oracle.com/pls/Apex/f?p=4550:1:2838412118981:
BANCO_PRUEBAS
ADMIN
password
It is interesting that, when I use APEX 5.0.1.00.06, I have some errors form appearing not using APEX 4.1.0.00.32
Check your 77569 application-> Page 1. I have modified the page element attributes. Now it's working.
Here are the changes (I will explain for P1_NOMBRE, did the same for the P1_APELLIDOS and P1_CATEGORIA):
- 'Source' has become article attributed to him include:
Source: Replacement always, value that exists in session state
Source type: column database
Source of value or an expression: NUMBER
- The "Default" article now the following attributes:
By default of Type: PL/SQL function body
Default value:
DECLARE L_NOMBRE B_LISTA_EMPLEADOS.NOMBRE%TYPE; BEGIN select NOMBRE into L_NOMBRE from B_LISTA_EMPLEADOS where USERNAME = :APP_USER; RETURN L_NOMBRE; EXCEPTION WHEN NO_DATA_FOUND THEN RETURN NULL; END;
Kind regards
Kiran
-
Query SQL to see User has it that all the resources provided!
Hi guys,.
Have a SQL query to find out what resources are provisioned to a particular user?
Thank you
SurenHello
Hope this will help you.
SELECT distinct usr_login as 'IdM User ID',
usr_employeeID as "Employee ID"
usr. USR_FIRST_NAME as "First Name."
usr. USR_LAST_NAME as 'Last Name,'
usr_status
as "State of the user."USR_EMP_TYPE as "employee Type.
obj.obj_name as 'Application resource',
ost_status as 'State of enforcement resources.The OST, Ouedraogo, obj, usr, Olivier
WHERE oiu.ost_key = ost.ost_key AND obj.obj_key = obi.obj_key AND oiu.usr_key = usr.usr_key
AND ost_status in ('set' 'Revoked', 'Disabled', 'Configuration')
AND oiu.obi_key = obi.obi_key
AND usr_EmployeeID like '11111'This query will provide all of the resources to which the user is associated and the State of the resources is 'Set', 'Revoked', 'Disabled', 'Provisioning' status for a particular ID mandatory, I'm not completely sure whether or not I gave the correct table USR employee ID column. Check once and query the DB
Maybe you are looking for
-
Satellite L650-OED under construction speakers of crackling and his intermittent
Hello. I just buy a new laptop (L650-OED) that is running windows 7-32 bit. The built-in speakers make a crackling noise and do work only intermittently. When you adjust the volume upward or down, they work for a few seconds and then cut. I tested th
-
iMovie tries to hug to download (2G) and I have no idea why, or what it is. Any suggestions? I can pause via Launchpad, but no other real options are offered. Either let it download or Dungeon, he paused. Thank you Mike
-
Droid Life indicates an update to D3
I've seen three (. 903,.905 et.906) potential updates floating around the net in the last month or so. I suppose that the latter is the version that we will actually get. http://www.droid-life.com/2012/03/07/droid-3-looking-at-new-update-from-Motorol
-
I've been locked out of the Xbox.
Original title: x - box locked out Please can someone help, Im locked out of my x - box, don't remember not security issue, cannot answer e-mail question as don't send emails, pay for a gold at the store subscription and have more card with number an
-
What will happen to the existing recovery partition
I have an Inspiron desktop with a pre-installed recovery disc/partition. I am currently running Windows 7. What will happen to that partition and its content, should I decide to use the free update of Microsoft for host1 0? Should what steps I take,