Change the query to a Count (*)
SELECT oh1.partner 'Dealer,'OD.sales_code 'merchant sales Code. "
OH1. external_order_number 'Original merchant order number. "
OH1. Region,
Cust. billing_account_number "BAN."
DSL.n_order 'DSL OrderNo. "
DSL.tn_or_ftn "TN DSL."
DSL.activation_date DSL"Activation", ".
Telco.TN "ACCESS_TN"
TO_CHAR (oh1.created_ts, "YYYY-MM-DD") "Date of the original order.
Pack1.display_name 'original Description of the order. "
Pack1.price 'Price Plan',
uname. USER_FIRST_NAME 'Agent First Name. "
uname. USER_LAST_NAME 'Agent Last Name',
uname.User_Name "Agent ID",
-to_char (dh.timestamp, ' yyyy-mm-dd hh: mi ') "USCS Button Pressed",
TO_CHAR (oh2.created_ts, 'YYYY-MM-DD') 'USCS Order Date. "
Pack2.display_name "USCS - order Description."
CASE
WHEN cd.state IN ('1 ', ' 15') THEN "RECEIVED".
WHEN cd.state IN ('2') THEN 'TRANSFORMATION '.
WHEN cd.state IN ('3', '8', ' 16', ' 18') THEN 'FINISH '.
WHEN cd.state IN ('4 ', '9', ' 17') THEN 'CANCELLED '.
WHEN cd.state ('6', '10', ' 13', ' 14') THEN 'PENDING '.
WHEN cd.state IN ('7') THEN 'INCOMPLETE '.
WHEN cd.state IN ('12', ' 19', ' 20') THEN 'PRESENTED '.
ANOTHER 'OTHER '.
END AS state_desc,
Pack2.price "USCS - Plan price."
Pack2.price - pack1.price "Net change"
INA.first_name,
INA.last_name,
INA.add_line_1,
Ina.City,
INA. STATE,
INA.zip
OF ain.impl_oh_order_header oh1
INNER JOIN ain.impl_oh_order_header ON oh1.external_order_number = oh2.external_order_number oh2
INNER JOIN ain.impl_order_data ON oh1.transaction_id = od.transaction_id od
INNER JOIN ain.impl_package ON oh1.transaction_id = pack1.transaction_id pack1
INNER JOIN ain.impl_package ON oh2.transaction_id = pack2.transaction_id pack2
INNER JOIN ain.impl_name_address ON oh1.transaction_id = ina.transaction_id ina
INNER JOIN ain.impl_customer ON oh2.transaction_id = cust.transaction_id cust
LEFT OUTER JOIN ain.impl_dsl ON oh2.transaction_id = dsl.transaction_id dsl
LEFT OUTER JOIN ain.impl_access ON oh2.transaction_id = telco.transaction_id telco
INNER JOIN ain.sncr_order_curr_disp ON cd.transaction_id = oh2.transaction_id cd
INNER JOIN AIN.sncr_order_disp_head ON oh1.transaction_id = dh.transaction_id dh
INNER JOIN ain.sncr_order_disposition ON dh.disp_transaction_id = disp.disp_transaction_id disp
INNER JOIN ain.sncr_ssm_principal ON uname.user_id = dh.user_id uname
WHERE the oh2.created_ts BETWEEN to_date (' 01/03/2012 00:00:00 "," mm/dd/yyyy hh24:mi:ss') AND to_date (' 31/03/2012 23:59 ',' dd/mm/yyyy hh24:mi:ss')
AND oh1.uscs = 0 AND oh2.uscs = 1
AND oh1.external_order_number NOT LIKE '% PROD_TEST % '.
AND oh2.external_order_number NOT LIKE '% PROD_TEST % '.
AND oh1.order_type = 'COMMAND '.
AND oh2.order_type = 'COMMAND '.
AND pack1.product_type = 'COMMAND '.
AND pack2.product_type = 'COMMAND '.
AND disp.category = 110 AND disp.state = 5
AND disp.trx_seq = (SELECT MAX (trx_seq)
Ain.sncr_order_disposition sod, ain.sncr_order_disp_head pink
WHERE sodh.disp_transaction_id = sod.disp_transaction_id
AND sodh.transaction_id = oh1.transaction_id
AND sod.category = 110 AND sod.state = 5)
AND pack1.offer_id IS NOT NULL
AND pack2.offer_id IS NOT NULL
AND ina.type = 'SERVICE '.
AND cd.category = 100
ORDER BY to_char (oh2.created_ts, ' YYYY-MM-DD "")
Do you understand the technique that gave you yesterday? Just because your query has been modified, the response has not. For any question, you can always do
SELECT COUNT(*)
FROM (<>)
It doesn't matter what query you have, you can always wrap up with a COUNT (*) SELECT to count the number.
Justin
Tags: Database
Similar Questions
-
Change the query to a display object
I have a view currently, object based on an entity. It is the default view object, which means that the query the view object is frank, he grabs all the attributes of the table. And there is no WHERE clause.
Actually, I only want to show a finite set of rows in my table. Whenever a record is modified/edited in this entity and committed, a new row in the database is created with the same information (I use CreateWithParams) with the exception of a few columns.
I actually didn't really update it on this table, just creating new lines. But to the user, I want it 'looks' like they change something in the table.
Example:
12, 11:32, Thompson, 60 (changes to the user this information in a table of the adf and a new line is created in the comic book)
12, 11:55, Thompson, 75
I have a timestamp field (see above) in the database that is used as part of my primary key, while I know that is later.
When executing the query of the VO, I want the user to only see as the last row of the db.
12, 11:55, Thompson, 75
Then...
I went to my VO, and I changed the query WHERE to add this:
where t1. TimeStamp = (Select MAX (t2. (TimeStamp) OF THE rcl.x t2 where t1.uid = t2.uid);
Now, this isn't a question of mysql/sql. There is actually a better query I was running, but the editor of the VO does not allow me to change the query itself...
When I save the new WHERE to my VO, rerun my page, I get the expected result (showing me only the latest recordings).
However, when I try and do a sort on the table in which are displayed my data, I get now ORDER BY errors.
I don't want my VO SQL read-only basis. I want to be able to update my table, so I have my VO running out of the entity.
Why don't the VO allows me to change the query itself? (As do a subquery instead of having my where clause to do the job)
Why are sorted by errors are thrown when I sort on my adf table after changing the where clause in my opinion?
I hope I was not too complicated in explanation of my problem...
Thanks in advance,
JoelHello
You can switch the VO query editor based on an EO to expert mode. This allows you to change the entire query. Unless you change the use of the attribute, the update through this VO work. Open the VO query and choose the Expert mode option of the query to see what I mean
Frank
-
Extend the VO - need to change the query of VO - screen is off
{Re-post the message in this forum (thanks to John Stegeman to lead me here...) {Posted: August 28, 2009 04:27}
Dear all,
Thanks to this great body of knowledge, I ask my questions.
I need to extend a VO to display the name of the country.
The column is not in the VO. So, I need to get another table: FndTerritories
I want to change the query, but the request frame is turned off (in the wizard the View - step 5 of 6 - Generated statement object substitution)
Could you be it someone please let me know: how to change the application of the VO in this case?
OR is there another solution for such cases, to maintain development standards
Thank you very much
Kind regardsHello
I think that's when you just have to add an attribute, you should not click the expert mode checkbox... make use of
Mix and add the button.But when you need to modify the query, and then we want to use to modify the query window...
Thank you
Gerard -
Hello
In the following update query
I want to update all the records in the column of bk_rating_id when the value of bk_rating_id is to HDB HDFC, the bk_rating_id column is to have values as shown below:update C2C_BK_RATING_23112011 f set f.bk_rating_id = 'HDB' where f.bk_rating_id like 'HDFC';
How can I change the update query to make the output voltage:HDFC 10 HDFC 2 HDFC 3 HDFC 4 HDFC 5 HDFC 6 HDFC 7 HDFC 8 HDFC 9 HDFC 1
HDB 10 HDB 2 HDB 3 HDB 4 HDB 5 HDB 6 HDB 7 HDB 8 HDB 9 HDB 1
Hello
Like this:update C2C_BK_RATING_23112011 f set f.bk_rating_id = REPLACE(bk_rating_id,'HDFC','HDB') where f.bk_rating_id like 'HDFC%';
-
Hi APEX Dev Team.
I found a bug (or I don't know how to get around unexpected behavior) in APEX_COLLECTION. CREATE_COLLECTION_FROM_QUERY_B. I think that it also applies to the CREATE_COLLECTION_FROM_QUERY.
What's happening: some strings are replaced in the query, I pass into the function. for example '22% ' is replaced by a white. It is not good if I have a query like this:
This returns no rows in the collection. If I run this query in SQL Developer she returns 5 rows.SELECT MYCOLA, MYCOLB, MYCOLC FROM MYTABLEA WHERE MYPHONE LIKE '%22306%';
When I change the declaration subsequently, it returns 5 rows in the collection.
Trace shows me, the first SELECT statement is replaced bySELECT MYCOLA, MYCOLB, MYCOLC FROM MYTABLEA WHERE MYPHONE LIKE '%2306%';
Which is obviously false :-)SELECT MYCOLA, MYCOLB, MYCOLC FROM MYTABLEA WHERE MYPHONE LIKE ' 306%';
The changes seem to be limited to 22%, I found no other characters encoding URLS that are replaced in the query.
Please fix, as I can't find any workaround.
Thank you
Peter
-----
Blog: http://www.oracle-and-apex.com
ApexLib: http://apexlib.oracleapex.info
BuilderPlugin: http://builderplugin.oracleapex.info
Work: http://www.click-click.atHi Peter,.
Thanks for reporting this. This seems to be a legacy logic which is no longer necessary (the logic to replace the string '22% '). I corrected it to Application Express 4.1.
To work around the problem, you can concatenate this string in your application, allowing you to avoid this logic. For example,.
SELECT MYCOLA, MYCOLB, MYCOLC FROM MYTABLEA WHERE MYPHONE LIKE '%2 '. 2306 ' %';
Thanks again.
Joel
-
How do I dynamically change the query VO
Hello
IAM trying to change the VO query dynamically. My forced, it is that I have 6 columns in a page header 3 columns (single default) for objective sort and another 3 columns (the default one) for querying data.
Al, are in a single view so I created a VO.
Sort of research
AN A
B B
C C
When I give all sort values and hit the query of VO submit button should change dynamically.
I searched old post in this regard.
My query is something like that
SELECT * from cust_table where a = NVL (: 1, a)
UNION
SELECT * from cust_table where a <>NVL (: 1, a)
order by one
IAM not trying the Sub part dynamicaly in my AM method
vo.setWherecaluse ("where a = NVL (: 1, a)")
UNION
SELECT * from cust_table where a <>NVL (: 1, a)
order by one ").
and trying to pass parameters to the query. But it does not work. In error "variable binding is not found.
The one you suggest how to solve the problem.
Thank you
MaheshMahesh
Please let me know the logic behind the union of the same query with it. What is the problem you are having with
vo.setWhereClauseThank you
AJ -
ATG-short integration - change the query of the user's search term before being sent to short
All testing the ATG-short front-end search/browse integration in a commerce application of my organization, one of our QA team members noticed as a search term consisting of just a vertical pipe character ("" | "") would cause the full product catalog to return in the results of research, as if every product in the catalogue was a match to that search term.
This behavior can be seen in the Application of reference short JSP as well, so that this behavior does not appear to be caused by something that makes our custom application code.
It is an undesirable behavior for our application - the company prefers that we do not show the entire catalog of products at the same time unless he is cut down somehow (whether via a word search or by the application of filters of properties).
I plan to implement a solution to wash just ' | ' characters of the search term entry. It would be pretty easy to do on the client side, but as with any other web application input validation, we really want to do this on the side server.
I think that this should be done by the substitution of / expand part of the OOTB ATG pipeline where it sends the search request to short for treatment. However, this is not something I've done before. I read in Chapter 7 of the ATGEndecaIntegrationGuide.pdf ("application integration"), but it's not immediately obvious to me how/where I'd be better on the substitution of / extend an OOTB ATG component for making filter ' | ' characters in the search query term.
All the world is this kind of thing before? If so, could you please describe how you went to?
Thank you!
-Jon
I ended up implementing this as follows:
-Create a new class that extends the class InvokeAssembler;
-Implement a custom InvokeAssembler.properties file that points to my new class derived;
-In service () of the new derived class method, use methods of the DynamoHttpServletRequest to filter pipe characters in the value of the Ntt parameter and the query string. Then call super.service () to handle the demand.
-Jon
-
Change the image loading of counting
Hello
I want to change the image to my custom default image loading. There are a few style class availabe.
AF | document: splash-screen.
AF | document: splash-screen-cell
AF | document: splash-screen-content
AF | document: splash-screen-icon
AF | document: splash-screen-message
Can someone tell me what class style to use to change the loading image?
Thank you
$N
Published by: Sidibé Gandhi on May 4, 2011 06:58Change this entry for skin. the following excerpt comes from a skin of fusion style - desktop.css
/ * Splash screen icon * /.
AF | document: splash-screen-icon {}
content: url(/afr/ss.gif);
Width: 43px;
height: 48px;
vertical-align: middle;
} -
Links user to change the query option
I know it's a simple thing to do...
I have an example query:
< name cfquery = 'day' datasource = "" >
Select logday
of tbl_log
WHERE logday = "Tuesday".
< / cfquery >
I want to have a drop down menu where there is say a list of days, Monday > Sunday. When the user choices say Friday it then changes WHERE logday = 'Friday ';
I can't work work how to get the link to work. Should I combine it with a cfset?
Thank you
JamesYou train with the drop-down list of the day, you want to your select to look like the code below. Then on your action page, your where clause should resemble:
WHERE logday = 'form.selectedDay. ' -
Desktop
Try pressing Ctrl + Alt + arrow keys pointing UPWARDS.
See you soon. Mick Murphy - Microsoft partner
-
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?
-
Slow index by using the query. Fast with full table Scan.
Salvation;
(Thanks for the links)
Here's my question correctly formatted.
The query:
Works on 32 seconds!SELECT count(1) from ehgeoconstru ec where ec.TYPE='BAR' AND ( ec.birthDate <= TO_DATE('2009-10-06 11:52:12', 'YYYY-MM-DD HH24:MI:SS') ) and deathdate is null and substr(ec.strgfd, 1, length('[CIMText')) <> '[CIMText'
Same query, but with an extra where clause:
This is 400 seconds.SELECT count(1) from ehgeoconstru ec where ec.TYPE='BAR' and ( (ec.contextVersion = 'REALWORLD') --- ADDED HERE AND ( ec.birthDate <= TO_DATE('2009-10-06 11:52:12', 'YYYY-MM-DD HH24:MI:SS') ) ) and deathdate is null and substr(ec.strgfd, 1, length('[CIMText')) <> '[CIMText'
It should return data from a table, given the conditions.
The database version is Oracle9i Release 9.2.0.7.0
These are the parameters relevant for the optimizer:
Here is the output of the PLAN to EXPLAIN for the first quick query:SQL> show parameter optimizer NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ optimizer_dynamic_sampling integer 1 optimizer_features_enable string 9.2.0 optimizer_index_caching integer 99 optimizer_index_cost_adj integer 10 optimizer_max_permutations integer 2000 optimizer_mode string CHOOSE SQL>
Here is the output of the EXPLAIN of PLAN for slow queries:PLAN_TABLE_OUTPUT -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- | Id | Operation | Name | Rows | Bytes | Cost | -------------------------------------------------------------------------------- | 0 | SELECT STATEMENT | | | | | | 1 | SORT AGGREGATE | | | | | |* 2 | TABLE ACCESS FULL | EHCONS | | | | -------------------------------------------------------------------------------- Predicate Information (identified by operation id): --------------------------------------------------- PLAN_TABLE_OUTPUT -------------------------------------------------------------------------------- 2 - filter(SUBSTR("EC"."strgfd",1,8)<>'[CIMText' AND "EC"."DEATHDATE" IS NULL AND "EC"."BIRTHDATE"<=TO_DATE('2009-10-06 11:52:12', 'yyyy -mm-dd hh24:mi:ss') AND "EC"."TYPE"='BAR') Note: rule based optimization
The TKPROF output for this slow statement is:PLAN_TABLE_OUTPUT -------------------------------------------------------------------------------- | | | 1 | SORT AGGREGATE | | | | | |* 2 | TABLE ACCESS BY INDEX ROWID| ehgeoconstru | | | | |* 3 | INDEX RANGE SCAN | ehgeoconstru_VSN | | | | PLAN_TABLE_OUTPUT -------------------------------------------------------------------------------- Predicate Information (identified by operation id): --------------------------------------------------- 2 - filter(SUBSTR("EC"."strgfd",1,8)<>'[CIMText' AND "EC"."DEATHDATE" IS NULL AND "EC"."TYPE"='BAR') PLAN_TABLE_OUTPUT -------------------------------------------------------------------------------- 3 - access("EC"."CONTEXTVERSION"='REALWORLD' AND "EC"."BIRTHDATE"<=TO_DATE('2 009-10-06 11:52:12', 'yyyy-mm-dd hh24:mi:ss')) filter("EC"."BIRTHDATE"<=TO_DATE('2009-10-06 11:52:12', 'yyyy-mm-dd hh24: mi:ss')) Note: rule based optimization
Published by: PauloSMO on November 17, 2009 04:21TKPROF: Release 9.2.0.7.0 - Production on Tue Nov 17 14:46:32 2009 Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved. Trace file: gen_ora_3120.trc Sort options: prsela exeela fchela ******************************************************************************** count = number of times OCI procedure was executed cpu = cpu time in seconds executing elapsed = elapsed time in seconds executing disk = number of physical reads of buffers from disk query = number of buffers gotten for consistent read current = number of buffers gotten in current mode (usually for update) rows = number of rows processed by the fetch or execute call ******************************************************************************** SELECT count(1) from ehgeoconstru ec where ec.TYPE='BAR' and ( (ec.contextVersion = 'REALWORLD') AND ( ec.birthDate <= TO_DATE('2009-10-06 11:52:12', 'YYYY-MM-DD HH24:MI:SS') ) ) and deathdate is null and substr(ec.strgfd, 1, length('[CIMText')) <> '[CIMText' call count cpu elapsed disk query current rows ------- ------ -------- ---------- ---------- ---------- ---------- ---------- Parse 1 0.00 0.00 0 0 0 0 Execute 1 0.00 0.00 0 0 0 0 Fetch 2 0.00 538.12 162221 1355323 0 1 ------- ------ -------- ---------- ---------- ---------- ---------- ---------- total 4 0.00 538.12 162221 1355323 0 1 Misses in library cache during parse: 0 Optimizer goal: CHOOSE Parsing user id: 153 Rows Row Source Operation ------- --------------------------------------------------- 1 SORT AGGREGATE 27747 TABLE ACCESS BY INDEX ROWID OBJ#(73959) 2134955 INDEX RANGE SCAN OBJ#(73962) (object id 73962) ******************************************************************************** alter session set sql_trace=true call count cpu elapsed disk query current rows ------- ------ -------- ---------- ---------- ---------- ---------- ---------- Parse 0 0.00 0.00 0 0 0 0 Execute 1 0.00 0.02 0 0 0 0 Fetch 0 0.00 0.00 0 0 0 0 ------- ------ -------- ---------- ---------- ---------- ---------- ---------- total 1 0.00 0.02 0 0 0 0 Misses in library cache during parse: 0 Misses in library cache during execute: 1 Optimizer goal: CHOOSE Parsing user id: 153 ******************************************************************************** OVERALL TOTALS FOR ALL NON-RECURSIVE STATEMENTS call count cpu elapsed disk query current rows ------- ------ -------- ---------- ---------- ---------- ---------- ---------- Parse 1 0.00 0.00 0 0 0 0 Execute 2 0.00 0.02 0 0 0 0 Fetch 2 0.00 538.12 162221 1355323 0 1 ------- ------ -------- ---------- ---------- ---------- ---------- ---------- total 5 0.00 538.15 162221 1355323 0 1 Misses in library cache during parse: 0 Misses in library cache during execute: 1 OVERALL TOTALS FOR ALL RECURSIVE STATEMENTS call count cpu elapsed disk query current rows ------- ------ -------- ---------- ---------- ---------- ---------- ---------- Parse 0 0.00 0.00 0 0 0 0 Execute 0 0.00 0.00 0 0 0 0 Fetch 0 0.00 0.00 0 0 0 0 ------- ------ -------- ---------- ---------- ---------- ---------- ---------- total 0 0.00 0.00 0 0 0 0 Misses in library cache during parse: 0 2 user SQL statements in session. 0 internal SQL statements in session. 2 SQL statements in session. ******************************************************************************** Trace file: gen_ora_3120.trc Trace file compatibility: 9.02.00 Sort options: prsela exeela fchela 2 sessions in tracefile. 2 user SQL statements in trace file. 0 internal SQL statements in trace file. 2 SQL statements in trace file. 2 unique SQL statements in trace file. 94 lines in trace file.
Published by: PauloSMO on November 17, 2009 07:07
Published by: PauloSMO on November 17, 2009 07:38 - title changed to be more correct.Although your optimizer_mode is choosing, it seems that there are no statistics collected on ehgeoconstru. The absence of estimated costs and estimated row counts of each of the stages of the plan and the "Note: optimization based on rules" at the end of these two plans would tend to confirm this.
Optimizer_mode choose means that if statistics are collected then it will use the CBO, but if no statistic is present in any of the tables in the query, the optimizer to rule will be used. The RBO tends to be happy in the best of the index case. I guess the index ehgeoconstru_VSN contextversion as the main column and also includes the date of birth.
You can either gather statistics on the table (if all other tables have statistics) using dbms_stats.gather_table_stats, or suggest the query to use a full scan instead of index. Another solution would be to apply a function or an operation against the contextversion to prevent the use of the index. something like this:
SELECT COUNT(*) FROM ehgeoconstru ec WHERE ec.type='BAR' and ec.contextVersion||'' = 'REALWORLD' ec.birthDate <= TO_DATE('2009-10-06 11:52:12', 'YYYY-MM-DD HH24:MI:SS') and deathdate is null and SUBSTR(ec.strgfd, 1, LENGTH('[CIMText')) <> '[CIMText'
or maybe UPPER (ec.contextVersion) so that would not change the rows returned.
John
-
How can I change the contents of the 'most visited' in the Menu bar
Once Firefox stores 10 entries in "Most visited", there seems to be no way to change these entries (e.g. the installation program "Most visited" while it contains links to Web sites that I want under "Most visited").
When you search Firefox HELP 'most visited' you don't even no matter what success there.
You don't control that made the request, you can change the query, you can prefer 20 hits instead. The search for the address bar with the "AwesomeBar" feature might be more to your liking. In any case do not remove the entries in "Most visited" as you would remove real history
Most visited - bookmark smart folders - recently visited (history)
- https://support.Mozilla.com/questions/831554
- https://support.Mozilla.com/questions/858163#answer-225990
- After the creation of the bookmark to a "smart folder", you must, restart Firefox, after which the bookmark looks like a folder and will work properly.
- related: https://support.mozilla.com/kb/Smart%20Bookmarks%20folders (marked old)
- related: http://kb.mozillazine.org/Viewing_the_browsing_history_-_Firefox
AwesomeBar feature allows you to search your history and bookmarks in the location bar to (forward) press "Enter". See the address bar search (internal - full Auto)
See picture of some: I use the AwsomeBar internal search function-related configuration parameters.
-
To get the result of the query as the column format delimited
Hi all
I'm running under query to get database information using an automation tool. The output of the query we receive does not come with the defined value. Is there a way I can change the query to output delimited?
Please provide your valuable contributions
SELECT * FROM THE USER. DROP_DOWN_VALUE
WHERE (SELEC_ID IN (SELECT ID FROM THE USER. PLACE WHERE FIELD_NAME = 'TABLE_NAME'))
AND DEPENDENT_FIELD = 'XXXXXXX '.
The query output:
43202TRANSFORMERTRANSFORMERXXXXXXX
Expected results:
43202, TRANSFORMER, TRANSFORMER, XXXXXXX
Thanks and greetings
Riyas Hussain
I'm running under query to get database information using an automation tool. The output of the query we receive does not come with the defined value. Is there a way I can change the query to output delimited?
Just add / * csv * / in front of the query.
See examples of different formats in this article by Sql Dev PM Jeff Smith (a frequent contributor of forum):
SELECT / * csv * / * FROM scott.emp;
SELECT / * xml * / * FROM scott.emp;
SELECT / * html * / * FROM scott.emp;
SELECT / * delimited * / * FROM scott.emp;
SELECT / * INSERT * / * FROM scott.emp;
SELECT / * charger * / * FROM scott.emp;
SELECT / * fixed * / * FROM scott.emp;
SELECT / * text * / * FROM scott.emp;
-
Help with the query to select only one record from the result set in double
Hello
Please help with the query. Version of Oracle database we use is 10g R2.
I have a vision that is duplicated IDS, but they are used across the different functions. See below examples of data. Please help me with a query to select only one record (based on ID regardless of the area) from the bottom of the result set of duplicate records. For what is the point of view is there unique records, given the combination of the fields ID, Org, DF, dry, Sub-Sec
ID Org DF Sec Sub-Sec (163) CQ CPDM CPDM HD (163) PC ENG ENG ENG (163) CQ ASIC ASIC IS 8888 TS TAC TAC TAC (163) TS HE HE SW 6789 CQ INFO INFO FOS 6789 PC SECSYS SECSYS INFO1 6789 TS SECSYS SECSYS INFO2 9009 PC BMS BMS BMS1 My result set must eliminate the duplicate identifiers regardless of whoever we choose of the result set. (I mean without distinction Org, DF, s, Sub-s). My expected result set should be.
ID DSB DF SEC Sub-Sec (163) CQ CPDM CPDM HD 8888 TS TAC TAC TAC 6789 CQ INFO INFO FOS 9009 PC BMS BMS BMS1 Thank you
Orton
Hello
This sounds like a job for ROW_NUMBER:
WITH got_r_num AS
(
SELECT id, DSB, df, s, sub_sec org
ROW_NUMBER () OVER (PARTITION BY ID.
ORDER BY org
) AS r_num
OF view_x
)
SELECT id, DSB, df, sub_sec s,
OF got_r_num
WHERE r_num = 1
;
He is a Top - N query example, where you choose the elements of N (N = 1 in this case) from the top of an ordered list.
I hope that answers your question.
If not, post a small example of data (CREATE TABLE and INSERT, only relevant columns instructions) to your sample data and the results desired from these data. (I know that you said that you were a view selection. Just for this thread, pretending it is a picture and post simple CREATE TABLE and INSERT statements to simulate your point of view).
Point where the above query is to produce erroneous results, and explain, using specific examples, how you get the right results from data provided in these places. (I didn't quite understand the explanation above. I don't know why you want toID ORG DF DRY SUB_SEC
-- --- -- --- -------
1234 CQ DPRK DPRK HD
and is not
1234 IS CQ ASIC, ASIC
or
TS 1234 IT IT SW
or
1234 CQ ASIC ASIC HD
)
If you change the query at all, post your modified version.
Always say what version of Oracle you are using (for example, 11.2.0.2.0).See the FAQ forum: https://forums.oracle.com/message/9362002
Maybe you are looking for
-
I put tabs to open a blank tab, but each new tab has now google search images on it.
I did not choose as a google search engine - I won't be using google. I have tabs set to open a blank tab each time. I want a blank tab without the google search bar.
-
EliteBook 8560w: PCI Serial Port Driver
I have trouble finding drivers for my 8560w EliteBook After you have installed Windows 10 64 I lack a driver Shows Device Manger Type of aircraft; Other devices Manufacturer: unknown Location: Bus PCI 0. 22, 3 function device Device status: the drive
-
Dashboard reports a SMART with i100 32 GB error
Hi I just got an i100 for my machine. Dashboard running it reports that there is no alternative to re = attribution block he said threshold is 5% but display 0%, short and long test fail because of this. He said also 11.50.00 firmware is up to date a
-
Hello world I recently bought a z3 compact which is the second one I got... (unfortunately, I got one problem with the other). However, I turned on without load 30 min as the advice on the guide says. Now the battery totally... I would like to know h
-
get internet connection through another computer...
Hello I would go straight to the point :) I have a desktop running windows vista. I have a normal internet connection through a router that connects to the internet on this desktop computer. now, I also have a laptop with windows xp and here is what