Server fires two queries for grandtotal?
I have a report and he adds some totals.I checked the queries in the monitor session before and after adding the total general.
previously, only request was sent to the database server.
but after adding totals, server sends two database queries and my performance report declined.
Please suggest how to avoid this.
Hello
OBIEE wil always trigger a separate query for total. It is the expected behavior. You should look at other ways to improve the performance of the report as put by default filters so that OBIEE failed to prform sum huge data.
Kind regards
Sandeep
Tags: Business Intelligence
Similar Questions
-
Original title: two updates - for "SQL Server 2005 Service Pack 3 'and 'Power Poin 2007", throwing errors during installation
For several months, one day each on ' Windows Vista Bussiness "and"MS Office Professional 2007' install.
Relevant updates are:-
1 security Update for SQL Server 2005 Service Pack 3 (KB2494113)
2 update for Microsoft Office PowerPoint 2007 (KB2535818)
The lifted message when the update is "patch installer has stopped working".
Finally, the "errors:" are: -.
Code FF Windows Update has encountered an unknown error
Code 80070663 Windows Update has encountered an unknown error
I tried nmerous solutions suggested on the forums but nothing helped.
Please suggest what you please!
Hello
Have what troubleshooting steps you tried?
Answer to the above question could help us by providing the best troubleshooting steps.
However, visit the link below to download and install the update of security for Microsoft Office PowerPoint 2007 (KB2535818) update.
http://www.Microsoft.com/download/en/details.aspx?ID=24723 -
Plan of the hash value for two queries!
Hello
DB: Oracle 11g (11.2.0.3.0)
OS: RHEL 5
I have two question:
1. can two queries have the same hash value of the plan? I mean I have here are two queries:
SELECT /+ NO_MERGE * / MIN (payor.next_review_date). *
* Payer from *.
* WHERE payor.review_complete = 0 *.
* AND payor.closing_date IS NULL *.
* AND payor.patient_key = 10; *
and
SELECT MIN (payor.next_review_date)
* Payer from *.
* WHERE payor.review_complete = 0 *.
* AND payor.closing_date IS NULL *.
* AND payor.patient_key = 10; *
When I tried to examine the execution plan for the two motions, the hash value of the plan remains the same. This means that implementation plan for both queries are same? If so, then how Oracle includes or changes to the execution plan based on hint. If not, then what hash value of the plan represents?
2. If the plan with suspicion, and without suspicion is identical except for a given query except the number of lines and bytes. Do you mean this query with fewer lines and scanned bytes is better?
Thanks in advance
-Onkar>
1. can two queries have the same hash value of the plan?
>
Yes - as already said - but it's not just because of tips.Here is the example code that I use to show that Oracle does NOT simply use a text version of the query that you propose and compute a hash of it.
These two queries are radically different but have the same hash value; Oracle are not different at all.set serveroutput on set autotrace traceonly select * from DEPT A, EMP B where A.DEPTNO=B.DEPTNO SQL> select * from DEPT A, EMP B 2 where A.DEPTNO=B.DEPTNO 3 / 14 rows selected. Execution Plan ---------------------------------------------------------- Plan hash value: 844388907 select * from (select * from DEPT) A, (select * from EMP) B WHERE A.DEPTNO = B.DEPTNO SQL> select * from 2 (select * from DEPT) A, (select * from EMP) B 3 WHERE A.DEPTNO = B.DEPTNO 4 / 14 rows selected. Execution Plan ---------------------------------------------------------- Plan hash value: 844388907
-
The OCSP server has no status for the certificate
From just today, whenever I try to access www.fanfiction.net, I get this error message from FF: -.
"Secure connection failed".
An error occurred during a connection at www.fanfiction.net. The OCSP server has no status for the certificate. (Error code: sec_error_ocsp_unknown_cert) "I already tried removing the Cert8.db and Secmod.db and uncheck only the two OCSP parameters d ' option in advance. Neither work. The site is accessible to any other browser so it's really Firefox question.
Need advice on how to fix this ASAP.
the issue seems to have been fixed by the site already, you can go ahead and give security.ssl.enable_ocsp_stapling to true.
-
Original title: Reader Activation - down for Mainentance... for weeks?
When I try to activate my Microsoft Reader on Windows Mobile 6.5 (on a Samsung Omnia ii) or Windows 7 Home 32 bit, I got the message: Activation activation error Server Microsoft is not available to Microsoft's Activation Server is currently offline for regular maintenance or upgrade, or she may have technical difficulties now. Please try to activate later. At first I waited patiently the mainenance remaining or the technical problem to be solved... but I now have the message every time I tried to turn on the last two weeks. The server is really low? How the world do we get support on MS Reader? There has been a lot of complaints about the support for this product. Normally, I was able to get my camera Windows Mobile works, but lately nothing works. The Windows Mobile device appears somewhat spoil the activitation and demanded each month reactivation couple... but now I can not get anything to activate and it seems to be a server problem, not a PC or device issue. If someone has never penetrated the MS ranks to find someone who really knows what happens, please advise kindly. Thank you Joel at Bellevue
Interestingly, I tried to activate MS Reader on my HD2 tonight in preperation to give to my girlfriend (I'm getting a feeling tomorrow, she has several seldomly but I hope she'll get into the Kindle as the HD2 duel boots into Android).
My laptop is running W7 Pro with IE9, I'm a domain administrator.
Race through the activation that I generated an error 500 on the server each time.
With IE9 "Run As" administrator, it works.
I hope this helps.
-
Cannot connect two computers for games.
I am trying to connect two computers for games (Age of Empires 3) purposes, but when is connected the two with a cable ethernet (using a filter at one end adapter) nothing happens, I can't see not his computer on my laptop and it can't see my computer on his. In the game, I see his match but he can't see mine, and when I try to connect to the sound he says impossible to reach. Tried to make it work for days now and I'm at the end of my rope PLEASE HELP!
As a quick test to go Control Panel - firewall Windows and disabling the firewall to see if it works. If you have a 3rd party software AV Firewall control may be in this control panel software.
As the two PC is connected back to back without access to a DHCP server, they should award an APIPA IP address that should work. To eliminate the problems addressing assign a static IP on both.
Properties of the Control Panel - Network and sharing Center - change adapter settings - Rt click on Local Area connection-
In TCP/IP V4 each assign a static IP 192.168.0.X where x is between 1 and 254 and the 2 PC's are different so for example10 and 20, 100 or 1. The value of 255.255.255.0 subnet mask, save the changes and test the connection.
If disabling the firewall resolves you can add an exception to the firewall program to allow the age3.exe through the firewall. More information here, as you ar accommodation only play locally just look at the top.
-
combine the two queries analysis
Hi friends,
could you please help me to combine these two queries. The bottom one looks like, take too many resources.
FUNCTION XML_error_log ()P_i_xml IN XMLTYPE, p_i_event_key IN VARCHAR2,( )
RETURN VARCHAR2
IS
l_covered_product_header_id NUMBER ;
l_item_path VARCHAR2 (500);
xml_table XMLTYPE;
p_ret_code_o VARCHAR2 (5);
p_error_buff_o VARCHAR2 (2000);
l_user_id NUMBER (15) := fnd_global . user_id ;
l_implicit_product_name VARCHAR2 (40);
l_top_model_line_id oe_order_lines_all . top_model_line_id % TYPE;
main_error_check VARCHAR2 (100) := NULL;
main_error_check1 VARCHAR2 (100) := NULL;
l_status_log_status VARCHAR2 (1);
l_err_msg_log_status VARCHAR2 (4000);
p_o_status VARCHAR2 (100);
p_o_err_msg VARCHAR2 (100);
P_i_input_res_xml XMLTYPE;
BEGIN
p_o_status := 'S' ;
p_o_err_msg := NULL;
Dbms_output.put_line ()' Start... process_response_xml ');
FOR i
IN (SELECT x. code , x . gravity , x . Description
DE XMLTABLE ( )
xmlnamespaces (DEFAULT ' urn: xyz:ccw:config:common: data'()
, ' for $i in //error
Returns the element r {}
$i / code,.
$i / description.
$i / gravity
}'
By the WAY P_i_input_res_xml
COLUMNS
code VARCHAR2 (13) Path 'code'
, gravity VARCHAR2 (30) Path "gravity"
, Description VARCHAR2 (30) Path 'description'
) x )
LOOP
DBMS_OUTPUT.put_line ) ( )
' code : ' || i . code );
DBMS_OUTPUT.put_line ) ( )
' severity: ' || i . gravity );
DBMS_OUTPUT.put_line ) ( )
' description: ' || i . Description );
main_error_check := i . code of : main_error_check;
INSERT IN xxgco_config_validate ()event_status ERROR_CODE error_description ,error_severity creation_date event_key last_update_date( )
VALUES('E',i. code , i . Description , i . gravity SYSDATE, p_i_event_key , SYSDATE);
RETURN 'E' ;
END LOOP;
DBMS_OUTPUT.put_line ()' main_error_check:' : main_error_check);
DBMS_OUTPUT.put_line ()' COMPLETED:');
IF main_error_check IS NULL
THEN
FOR i
IN (SELECT x. code , x . gravity , x . Description , x . subcause
DE XMLTABLE ( )
xmlnamespaces (DEFAULT ' urn: xyz:ccw:config:common: data'()
, ' for $i in //message
Returns the element r {}
$i / code,.
$i / description.
$i / gravity,.
$i / subCause
}'
By the WAY P_i_input_res_xml
COLUMNS
code VARCHAR2 (13) Path 'code'
, gravity VARCHAR2 (30) Path "gravity"
, Description VARCHAR2 (30) Path 'description'
, subCause VARCHAR2 (50) Path "subCause"
) x )
LOOP
DBMS_OUTPUT.put_line ) ( )
"code:" || i . code );
DBMS_OUTPUT.put_line ) ( )
' severity: ' || i . gravity );
DBMS_OUTPUT.put_line ) ( )
' description: ' || i . Description );
DBMS_OUTPUT.put_line()' subCause:': i. subCause );
INSERT IN xxgco_config_validate ()event_status ERROR_CODE error_description ,error_severity error_cause creation_date event_key last_update_date( )
VALUES('E',i. code , i . Description , i . gravity , i . subcause SYSDATE, p_i_event_key , SYSDATE);
main_error_check1 := i . code of : main_error_check1;
END LOOP;
IF main_error_check1 IS NOT NULL
THEN
RETURN ('E');
ON THE OTHER
RETURN ('S');
END IF;
ON THE OTHER
-TODO Log main error Log
RETURN ('E');
END IF;
EXCEPTION
WHEN Others
THEN
p_o_err_msg :=
SUBSTR (
' Error in the response_XML_error_log FUNCTION:'
|| SUBSTR (SQLERRM, 1, 250)
|| ':'
|| DBMS_UTILITY.format_error_backtrace ,
1 ,
4000 );
RETURN 'E' ;
END XML_error_log ;
Thanks in advance
Ok.. This isn't a constructive debate...
-
Want to combine the two queries
Hello
It is my first post here, I hope it's a good place to put it.
I have two queries that both gave me the results. I guess that both are way more elegant or better to do what they do, but that's what I came with. So feel free to modify them. However, my real problem is I want to combine these two queries in a single query, removing duplicate information.
analytical_query
SELECT * from( select requisitions.acc_id AS "Accession #" ,requisitions.draw_date AS "Draw Date" ,requisitions.received_date AS "Received Date" ,req_panels.run_date AS "Run Date" ,tests.TEST_ID ,(CASE WHEN tests.TEST_ID IN (7101) THEN results.RESULT_NUMERIC*2 ELSE results.RESULT_NUMERIC END) AS RESULT_NUMERIC ,doctors.f_name || ' '|| doctors.l_name AS "Physician" ,organizations.state AS "State" FROM requisitions inner join req_panels ON requisitions.acc_id = req_panels.acc_id inner join results ON req_panels.rp_id = results.rp_id inner join tests ON results.test_id = tests.test_id inner join doctors ON requisitions.doc_id1 = doctors.doc_id inner join organizations ON requisitions.org_id = organizations.org_id WHERE requisitions.DEL_FLAG='F' AND req_panels.DEL_FLAG='F' AND results.DEL_FLAG='F' AND req_panels.PANEL_ID IN (7000,70001,70551) AND results.TEST_ID IN (7101,7102,7107,7108) AND requisitions.RECEIVED_DATE > TO_DATE('9/1/2013', 'MM/DD/YYYY') ORDER BY requisitions.ACC_ID ) pivot( MAX(RESULT_NUMERIC) for TEST_ID IN ('7101' AS CRP,'7102' AS Hemoglobin,'7107' AS "LDT Run 1",'7108' AS "LDT RUN 2") )
culture_query
SELECT * from( select requisitions.acc_id AS "Accession #" ,MAX(requisitions.draw_date) AS "Draw Date" ,MAX(requisitions.received_date) AS "Received Date" ,MAX(req_panels.run_date) AS "Run Date" ,tests.TEST_ID ,LISTAGG(results.RESULT_ALPHA, ';') WITHIN GROUP (ORDER BY results.RESULT_ALPHA) RESULT_ALPHA FROM requisitions inner join req_panels ON requisitions.acc_id = req_panels.acc_id inner join results ON req_panels.rp_id = results.rp_id inner join tests ON results.test_id = tests.test_id inner join doctors ON requisitions.doc_id1 = doctors.doc_id inner join organizations ON requisitions.org_id = organizations.org_id WHERE req_panels.PANEL_ID IN (7000,70001,70551) AND results.TEST_ID IN (10010,10052,11010) AND requisitions.RECEIVED_DATE > TO_DATE('9/1/2013', 'MM/DD/YYYY') AND requisitions.DEL_FLAG = 'F' AND req_panels.DEL_FLAG = 'F' AND results.DEL_FLAG = 'F' AND req_panels.RUN_DATE is not null group by requisitions.ACC_ID, tests.TEST_ID ) pivot( MAX(RESULT_ALPHA) for TEST_ID IN ('10010' AS "Organism",'10052' AS "Negative/No Growth", '11010' AS "Growth") )
Basically, what is missing from the first query is the global list of the 'RESULT_ALPHA' for 'TEST_ID"10010, 10052 and 11010 numbers. And because of the way they want to view this information that I had to tilt it, which is where I ran into problems. If anyone has any idea on how I can combine these two requests and make them more effective that would be great.
Thank you.
Hello
JayG30 wrote:
... I have however found a way to do what I would call "swivel conditional." ...
I think it's the crux of this problem; you want MAX BOF a few tests and LISTAGG for others. I don't know a good way to attract the SELECT... PIVOT to do both at the same time. I think it's one of those situations where SOME... PIVOT is not the best tool for the job; MAX (CASE...) and LISTAGG (CASE...) may be more practical and more effective:
SELECT rq.acc_id
, MAX (rq.draw_date) AS "the draw Date.
, MAX (rq.received_date) as BEING "received Date".
, MAX (rp.run_date) AS "Date of the race.
, MAX (CASE WHEN rs.test_id = 7101 THEN rs.result_numeric * END 2) AS the crp
, MAX (CASE WHEN rs.test_id = 7102 THEN rs.result_numeric END) AS hemoglobin
, MAX (CASE WHEN rs.test_id = 7107 THEN rs.result_numeric END) AS "LDT Run 1.
, MAX (CASE WHEN rs.test_id = 7108 THEN rs.result_numeric END) AS "LDT, 2nd round.
, LISTAGG (CASE WHEN rs.test_id = 10010 THEN rs.result_alpha END)
, ';'
) Within GROUP (ORDER BY rs.result_alpha) AS "organization".
, LISTAGG (CASE WHEN rs.test_id = 11010 THEN rs.result_alpha END)
, ';'
) Within GROUP (ORDER BY rs.result_alpha) AS a 'growth '.
, LISTAGG (CASE WHEN rs.test_id = 10052 THEN rs.result_alpha END)
, ';'
) Within GROUP (ORDER BY rs.result_alpha) AS 'Negative/No growth '.
Rq requisitions
INNER JOIN req_panels ON rp.acc_id = rq.acc_id PR
INNER JOIN results rs ON rs.rp_id = rp.rp_id
WHERE rq.del_flag = 'F'
AND rp.del_flag = 'F'
AND rs.del_flag = 'F'
AND rp.run_date IS NOT NULL
GROUP BY rq.acc_id
ORDER BY rq.acc_id
;
I don't quite get the results you have posted; for example, I don't see how you get a row of results with 'Accession' = 142425, while acc_id does not occur in the sample data. It was maybe just a typo.
-
Help to combine the two queries with dependencies
Combining two queries with dependencies:First ask: Returns USER_ID that has a type of access to a table with the OWNER (I also shoot the TLA of the USER_ID standard: ' of TLA #)Select distinct SUBSTR (DBA_USERS. Username, 2, 3) AS TLA
DBA_USERS. Username USED_ID
DBA_TAB_PRIVS. Owner OWNER
from DBA_USERS
DBA_ROLE_PRIVS
DBA_TAB_PRIVS
where DBA_USERS. Username = DBA_ROLE_PRIVS. Dealer
and DBA_USERS.default_tablespace not in ('SYSTEM', "SYSAUX")
and DBA_USERS. Username like would be %'
and DBA_ROLE_PRIVS. Granted_role = DBA_TAB_PRIVS. Dealer
and SUBSTR (DBA_USERS. Username, 2, 3) <>DBA_TAB_PRIVS. Owner
;
Example of results (red font used in the last citation):TLA USED_ID OWNER
--- ------------------------------ ------------------------------
DGTX999 GTX GRR
DGTX999 GTX ABG
DGTX999 GTX HTC
FWS DFWS999 GRR
OCN DOCN999 GRR
RHR DRHR999 DAS
ETM DETM999 DAS
FWS DFWS995 DAS
CD DCDS999 DAS
ABE DABE999 DAS
Second request: matches the USER name (same standards as above) and MACHINES (filter PC connections) and the number of connections made ofSelect DBA_USERS. Username
DBA_HIST_ACTIVE_SESS_HISTORY. Machine
COUNT (*) AS CONN_COUNT
of DBA_HIST_ACTIVE_SESS_HISTORY
DBA_USERS
where DBA_HIST_ACTIVE_SESS_HISTORY. User_id = DBA_USERS. User_id
and DBA_USERS. Username like would be %'
and DBA_HIST_ACTIVE_SESS_HISTORY. Machine not as "WINAD%\%-%".
Group of DBA_USERS. Username
DBA_HIST_ACTIVE_SESS_HISTORY. Machine
order by 1
3 desc;
Example of results (red font used in the last citation):MACHINE CONN_COUNT USERNAME
--------------- ------------------------- ----------
DFWS999 home13e0 7557
DGAM800 vu1246 37
DGAM999 vu1246 2558
DABE999 back18cb 4639
DINL888 home162f 84
DFWS999 WINDAD\OMHQ58BF 178
DCDS999 back18cb 788
DGTX999 home18c8 7
DGTX999 home13d3 62
DOCN999 vu1261 44
DFWS999 back1976 3
DCDS999 home18c8 173
DGTX999 home19c9 13
What I'd like to have (just made two first USER_IDs from the first query) (COL duplicated for each separate owner 1-4). So 3 machines and 3 owners would result in 9 lines (I could reorganize the collar and use a 'pause'):
TLA USED_ID MACHINE CONN_COUNT OWNER
--- ------------------------------ ------------------------- ---------- ------------------------------
GTX DGTX999 home13d3 62 GRR
Home18c8 GTX DGTX999 7 GRR
DGTX999 GTX home19c9 GRR 6
GTX DGTX999 home13d3 62 ABG
DGTX999 GTX home18c8 ABG 7
DGTX999 GTX home19c9 6 GBS
GTX DGTX999 home13d3 62 CTH
DGTX999 GTX HTC 7 home18c8
DGTX999 GTX home19c9 6 HTC
FWS DFWS999 home13e0 7557 GRR
FWS DFWS999 WINDAD\OMHQ58BF 178 GRR
FWS DFWS999 back1976 GRR 3
So it would be logically read: TLA as USER_ID of MACHINE, CONN_COUNT consultation times: OWNER information.Thought as only those with the necessary values. Just try this and let me know in the case of all conflicts in the output.
WITH T1 AS)
Select distinct SUBSTR (DBA_USERS. Username, 2, 3) AS TLA
DBA_USERS. Username USED_ID
DBA_TAB_PRIVS. Owner OWNER
ROWNUM RN
from DBA_USERS
DBA_ROLE_PRIVS
DBA_TAB_PRIVS
where DBA_USERS. Username = DBA_ROLE_PRIVS. Dealer
and DBA_USERS.default_tablespace not in ('SYSTEM', "SYSAUX")
and DBA_USERS. Username like would be %'
and DBA_ROLE_PRIVS. Granted_role = DBA_TAB_PRIVS. Dealer
and SUBSTR (DBA_USERS. Username, 2, 3) <> DBA_TAB_PRIVS. Owner),
() AS T2
Select DBA_USERS. Username
DBA_HIST_ACTIVE_SESS_HISTORY. Machine
COUNT (*) AS CONN_COUNT
of DBA_HIST_ACTIVE_SESS_HISTORY
DBA_USERS
where DBA_HIST_ACTIVE_SESS_HISTORY. User_id = DBA_USERS. User_id
and DBA_USERS. Username like would be %'
and DBA_HIST_ACTIVE_SESS_HISTORY. Machine not as "WINAD%\%-%".
Group of DBA_USERS. Username
DBA_HIST_ACTIVE_SESS_HISTORY. Machine
order by 1
3 desc)
SELECT T1. TLA
, T1. USED_ID
, T2. MACHINE
, T2. CONN_COUNT
, T1. OWNER
FROM T1
T2
WHERE T1. USED_ID = T2. USER NAME;
-
two queries against aud$ with different results
Hi guys
I'm not so good with queries and it is the reason for my question:
We have active audit and we want to get the following information (monthly):
- -How many times the logon user to the database.
- -each logon to each user in a month.
For the first (1) obligation for us to have the following query:
select USERID "Cuenta", USERHOST, TERMINAL, nombres||' '||PRIMER_APELLIDO||' '||SEGUNDO_APELLIDO "WhiteList" , count(*) "TOTAL" from aud$, ab.usuarios where (ACTION# = 100) and (NTIMESTAMP# between (to_date(to_char('01092013 00:00:00'),'ddmmyyyy HH24:MI:SS')) and (to_date(to_char('30092013 23:59:00'),'ddmmyyyy HH24:MI:SS'))) and USERID = CODIGO_USUARIO(+) and USERID not in ('DBSNMP','SYSMAN') group by USERID, USERHOST, TERMINAL, nombres||' '||PRIMER_APELLIDO||' '||SEGUNDO_APELLIDO order by USERID, USERHOST, TERMINAL;
the result of this query shows like this:
Header 1 Cuenta USERHOST TERMINAL WhiteList TOTAL
-------------------- ------------------------- --------------- ---------------------------------------- ----------
ASEGUR MAQUINADIAB\SSSSS IUOOO PEPITO GARCIA GARCIA Y SOCIED 10
ASEGUR POSADASDE\MNNN4550094 MNNN4550094 PEPITO GARCIA GARCIA Y SOCIED 1
ASEGUR POSADASDE\YUMI YUMI PEPITO GARCIA GARCIA Y SOCIED 10
ASEGUR YUH PEPITO GARCIA GARCIA Y SOCIED 20
ASEGUR SDFRG PEPITO GARCIA GARCIA Y SOCIED 13
ASEGUR signy PEPITO GARCIA Y GARCIA SOCIED 29
Sigurd ASEGUR PEPITO GARCIA Y GARCIA SOCIED 32
ASEGUR valhalla-Legacy PEPITO GARCIA Y GARCIA SOCIED 12
ADMIN MAQUINADIAB\SSSSS IUOOO USER ADMINISTRATOR NETWORKING 3
SPRINGUSR bragi 98
SPRINGUSR hermod 59
SPRINGUSR YUH 49
Therefore, total logons per month per user.
for the second requirement, we use the tracking query:
select USERID "Cuenta", USERHOST, TERMINAL, to_char(NTIMESTAMP#,'YYYYMMDD HH24:MI:SS') "Fec Ing", nombres||' '||PRIMER_APELLIDO||' '||SEGUNDO_APELLIDO "WhiteList" --, count(*) "TOTAL" from aud$, ab.usuarios where (ACTION# = 100) and --to_char(NTIMESTAMP#,'dd-mm-yy')=to_char(sysdate-50,'dd-mm-yy') and (NTIMESTAMP# between (to_date(to_char('01062013 18:00:00'),'ddmmyyyy HH24:MI:SS')) and (to_date(to_char('30062013 23:59:00'),'ddmmyyyy HH24:MI:SS'))) and USERID = CODIGO_USUARIO(+) and USERID not in ('DBSNMP','SYSMAN') group by USERID, USERHOST, TERMINAL,to_char(NTIMESTAMP#,'YYYYMMDD HH24:MI:SS'), nombres||' '||PRIMER_APELLIDO||' '||SEGUNDO_APELLIDO order by USERID, USERHOST, TERMINAL;
Header 1 Cuenta USERHOST Fec TERMINAL Ing white list
-------------------- ------------------------- --------------- -------------------- ----------------------------------------
UTILISATEUR12 DOMINIODDD\IOIPOP IOIPOP 20130930 12:08:33 ANGEL ROBERTO GARCIA Y GARCIA S
UTILISATEUR12 DOMINIODDD\IOIPOP IOIPOP 20130930 14:28:47 ANGEL ROBERTO GARCIA Y GARCIA S
UTILISATEUR12 DOMINIODDD\IOIPOP IOIPOP 20130930 16:24:43 ANGEL ROBERTO GARCIA Y GARCIA S
Thus, shows the opening of each session conducted per user per month.
But in the two queries, the results are different. This is not to assume that they must have the same number of logons?
I mean, if I have summarized the numbers in the TOTAL column I less that I get in the second query. Always!
could you help us?
Thank you
Hello
Why you use GROUP BY in the second query, remove it from the second query, then result will be the same
HTH
-
How to combine the two queries into a single
Hi gurus,
SQL > select * from v version $;
BANNER
----------------------------------------------------------------
Oracle Database 10g Release 10.2.0.4.0 - Production 64-bit
PL/SQL Release 10.2.0.4.0 - Production
CORE 10.2.0.4.0 Production
AMT for Linux: release 10.2.0.4.0 - Production
NLSRTL Version 10.2.0.4.0 - Production
SQL >
I have following two queries. How can I convert these two queries into one with the same result?
1ST QUARTER
SELECT id, $vdate, SupplierName, venddate, vid
THE SELLER
WHERE processid = 32
AND venddate is null
AND vid to (select vid from view_vid where type = 'PDX')
AND (id, $vdate) not in (select id, $vdate from vkfl_is where task_id = 55)
AND (id, $vdate) in (select id, vidate from market_data where marketed_date is null)
AND id not in (select id from location)
Q2
SELECT id, $vdate, SupplierName, venddate, vid
THE SELLER
WHERE processid = 20
AND venddate is null
AND vid to (select vid from view_vid where type = 'PBX')
AND (id, $vdate) not in (select id, $vdate from vkfl_is where task_id = 40)
AND (id, $vdate) in (select id, vidate from market_data where region_date is null)
AND id not in (select id from location)
I can the UNION queries these two, but is there some way I can write a single query that gives me the same result as above two queries?
Any help would be much appreciated
Thanks in advance
Sorry, it lack
SELECT id, $vdate, SupplierName, venddate, vid
THE SELLER
ProcessID WHERE in (32.20)
AND venddate is null
AND vid to (select vid from view_vid where type = case when processid = 32
then "PDX".
else "PBX".
end)
AND (id, $vdate) not in (select id, $vdate from vkfl_is where task_id = case when processid = 32
then 55
40 else
end)
AND (id, $vdate) in (select id, vidate from market_data cases where processid = 32)
then marketed_date
of other region_date
end to the null value
)
AND id not in (select id from location)
Concerning
Etbin
-
Any difference between the two queries
Hello
Could someone please help me to see if the following two queries return different results?
Thank you
Query A
SELECT A.BATCH_NO,
A.BU_CODE,
SUM (A.AMOUNT) AMOUNT
FROM TABLE_A HAS
WHERE A.BU_CODE = 20
AND G_DATE BETWEEN TO_DATE (JANUARY 31, 2013 ',' MON-DD-YYYY "")
AND TO_DATE (MARCH 31, 2013 ',' MON-DD-YYYY "")
--
AND A.BATCH_NO IN (SELECT BATCH_NO
TABLE_A B1
WHERE B1. BATCH_NO = A.BATCH_NO
AND B1. BU_CODE = A.BU_CODE
AND B1. ' CODE_P = ' 06-01-01-000.
AND B1. FROM_FLAG = 'FROM '.
)
AND A.BATCH_NO IN (SELECT BATCH_NO
FROM TABLE_A B
WHERE B.BATCH_NO = A.BATCH_NO
AND B.BU_CODE = A.BU_CODE
AND B1.ORG = '10'
)
A.BATCH_NO GROUP,
A.BU_CODE
;
Query B
SELECT A.BATCH_NO,
A.BU_CODE,
SUM (A.AMOUNT) AMOUNT
FROM TABLE_A HAS
WHERE A.BU_CODE = 20
AND G_DATE BETWEEN TO_DATE (JANUARY 31, 2013 ',' MON-DD-YYYY "")
AND TO_DATE (MARCH 31, 2013 ',' MON-DD-YYYY "")
--
AND A.BATCH_NO IN (SELECT BATCH_NO
TABLE_A B1
WHERE B1. BATCH_NO = A.BATCH_NO
AND B1. BU_CODE = A.BU_CODE
AND B1. ' CODE_P = ' 06-01-01-000.
AND B1. FROM_FLAG = 'FROM '.
AND B1.ORG = '10'
)
A.BATCH_NO GROUP,
A.BU_CODE
;
Hello
These 2 requests are not the same. Depending on your data, query A, can select more lines as searching for B.
I do not have access to your table, so I'll give an example of using the table scott.emp.
The following 2 queries look like your 2 questions:
SELECT deptno - query A
work
sal
FROM scott.emp m
WHERE deptno IN ((in English only)
SELECT sj.deptno
FROM scott.emp sj
WHERE sj.deptno = m.deptno
AND sj.job = 'CLERK '.
)
AND (IN) deptno
SELECT ss.deptno
FROM scott.emp ss
WHERE ss.deptno = m.deptno
AND ss.sal > 1200
)
;SELECT deptno - query B
work
sal
FROM scott.emp m
WHERE deptno IN ((in English only)
SELECT s.deptno
FROM scott.emp s
WHERE s.deptno = m.deptno
AND s.job = 'CLERK '.
AND s.sal > 1200
)
;The results of A query are all 14 rows in the table, but query B produces only 3 lines of deptno = 10.
Query A looking for departments who have committed and the departments that have sal > 1200. If a line in the Department has job = 'CLERK' (regardless of the sal), and another line was sal > 1200 (regardless of the work), while the Department meets both criteria.
Query B is looking for federal departments who have committed that sal is over 1200. Two criteria must be met on the same line.
-
Listener - two Services for each Instance
Oracle 11r2g has been installed on a Linux SO. Everything works, but when I check the listening Services I got this status:
lsnrctl services
(...)
Service "S060" has 1 instance (s).
Instance "S060', status UNKNOWN, has 1 operation for this service...
Managers:
"DEDICATED" implemented: 86 denied: 0
LOCAL SERVER
Service 'S060.domain' has 1 instance (s).
Instance "S060" READY State, has 1 operation for this service...
Managers:
"DEDICATED" implemented: 1289 refused: 0 status: ready
LOCAL SERVER
(...)
There are two Services for each Instance. Is this normal or do I check anything else?
Thanks in advance.910492 wrote:
Oracle 11r2g has been installed on a Linux SO. Everything works, but when I check the listening Services I got this status:lsnrctl services
(...)
Service "S060" has 1 instance (s).
Instance "S060', status UNKNOWN, has 1 operation for this service...
Managers:
"DEDICATED" implemented: 86 denied: 0
LOCAL SERVER
Service 'S060.domain' has 1 instance (s).
Instance "S060" READY State, has 1 operation for this service...
Managers:
"DEDICATED" implemented: 1289 refused: 0 status: ready
LOCAL SERVER
(...)There are two Services for each Instance. Is this normal or do I check anything else?
Thanks in advance.
Pretty normal. The 'unknown' is the static record from the SID_LIST of the listener.ora file entry. The 'loan' is the dynamic registration of the instance db itself.
-
MERGE TWO QUERIES...
Hi all
I have two queries like this...
I want to have a single query of the two tables satisfying condition where that show all RELATIONSHIP, FILED_NAME, P2. ATTRIBUTE, P3. ATTRIBUTE, DESCRIPTION of the AREA, the two SOURCE tables P3 AND P2.
Appreciate your help.
Thank you/kumar
Published by: kumar73 on May 28, 2010 09:49Hope you have understood my requirement.
Ah, I see now that I misread your question (it must be a 'weekend-thing' ;)).
Try something like this:
select p3.relation , p3.field_name , p2.attribute , p3.attribute , p3.value_description , p3.source from ( select relation, field_name, attribute, field_description, source from p3i2009q2_variable_info p3 where relation not in ('CHAI', 'ITAB', 'ITB2', 'ITB3', 'MINI', 'NOTE', 'MINC', 'FINI', 'FTIM', 'FWTG', 'FMLY', 'FMIS', 'FSUM', 'MEMB', 'FINC', 'FASO') and (substr(field_name, -2) in ('X1', 'X2', 'X3', 'X4', 'X5', 'X0', 'XA', 'XB', 'XM', 'XP', 'CM', 'MT') or substr(field_name, -1) in ('X') or substr(field_name, 1) in ('J')) and (attribute like 'NUM%' or attribute = '-') ) p3 , ( select relation, field_name, attribute, field_description, source from p2i2009m04_variable_info p2 where relation not in ('CHAI', 'ITAB', 'ITB2', 'ITB3', 'MINI', 'NOTE', 'MINC', 'FINI', 'FTIM', 'FWTG', 'FMLY', 'FMIS', 'FSUM', 'MEMB', 'FINC', 'FASO') and (substr(field_name, -2) in ('X1', 'X2', 'X3', 'X4', 'X5', 'X0', 'XA', 'XB', 'XM', 'XP', 'CM', 'MT') or substr(field_name, -1) in ('X') or substr(field_name, 1) in ('J')) and (attribute like 'NUM%' or attribute = '-') ) p2 where p3.relation = p2.relation order by relation;
You may need to adjust my untested example, for example you might need an outer join and/or add predicates more as you wish.
-
outer join: difference between two queries
Below two queries which should give the same results in my opinion. I want that all records of u_protocol and the pval.u_protocol_variable_value value if necessary.
Why the outer join in query2 does not work as in query1?
Query1:
Query2:select p.u_protocol_id, i.u_protocol_variable_value from lims_sys.u_protocol p, ( select pval.u_protocol_id, pval.u_protocol_variable_value from lims_sys.u_protocol_variable pvar, lims_sys.u_protocol_value_user pval where pvar.u_protocol_variable_id = pval.u_protocol_variable_id and pvar.name = 'VALUE_Protocol_Group' ) i where p.u_protocol_id = i.u_protocol_id (+)
select prt.u_protocol_id, pval.u_protocol_variable_value from lims_sys.u_protocol prt, lims_sys.u_protocol_variable pvar, lims_sys.u_protocol_value_user pval where pvar.u_protocol_variable_id = pval.u_protocol_variable_id and prt.u_protocol_id = pval.u_protocol_id (+) and pvar.name = 'VALUE_Protocol_Group'
Hello
When you perform an outer join, all conditions on the tables in option must be outer join conditions. Otherwise, the effect is an inner join.
There is one exception: cascade of outer joins, external-junction b of a and c is outside attached to b. In this case, in the b - c join only columns of c are marked with the sign +.Re - write to obtain the same results as query1, query2 like this:
select prt.u_protocol_id , pval.u_protocol_variable_value from lims_sys.u_protocol prt , lims_sys.u_protocol_variable pvar , lims_sys.u_protocol_value_user pval where pvar.u_protocol_variable_id (+) = pval.u_protocol_variable_id -- cascading outer join and prt.u_protocol_id = pval.u_protocol_id (+) and pvar.name (+) = 'VALUE_Protocol_Group' -- (+) added ;
I find the syntax ANSI easier to use for all the joins and much easier for outer joins.
Maybe you are looking for
-
How to import old emails having accidentally deleted the email account?
I have deleted my thunderbird e-mail account and now cannot access the mails I received. I'm trying to find them on the computer and import them, but don't know how to do. I use thunderbird on windows 8.1. Any help is appreciated!
-
Firefox displays my homepage (cbc.ca) in a narrow band of 7 "in the middle of my screen 20 '' HP300 AIO. IE allows me to zoom in on each side of the bar to 100%. How can I do this in FireFox?
-
Problem of processor on the Satellite A200 - 14 d?
Hello, I have a Satellite A200 14 d and I installed Vista. Recently, I downloaded CPU - Z and had a look at the details of the processor. There is one annoying thing: falls the processor speed of 1800 Mhz to 700 Mhz, whenever it is not being used, ev
-
Flatten to a string to send arbitrary objects by messages from the user interface?
Hi people, I am trying to send arbitrary data by messages from the user interface defined by the user to my labview interface. Something funny happens then: if I send the data through the message of ui, it seems I have something strange. There is onl
-
My HP Pavilion has an AMD Radeon 7570 HD that has a very noisy fan. Is there a cure for this?