Separate Queries, Separate Group By's w/ Wizard
I used the wizard to create a report w/ two queries. Using the wizard, I set the first query to designate a specific field as a group field. When I added the second query via the wizard, the step to set a field as a group field was skipped over.
I need to specify a field in the second query as a group field, how can I do this?
There is no count(*) or group by selector in JCR SQL [1], XPath [2] or
JCR-SQL2/AQM [3].
Similar Messages
-
Two separate queries in one report
Hi Gurus,
Is it possible to make two separate queries in the same worksheet (I need to have a column in my report from a different query from this report). As we can have more than one query in Oracle Reports, similarly, is it possible to have more than one query in Oracle Discoverer Report.
Thanks,
PoojaThe functionality your looking for is not available in Discoverer today. You can have two separate worksheets within Discoverer, one to run each query. Another option is only available in Discoverer Desktop, it is called a subquery which allows you to run one query and then pass the results as a parameter into your workbook. However, I don't believe either of those options resolve the problem your looking to solve.
Matt Topper
TUSC, The Oracle Experts
[email protected] -
OBIEE: Link Two Separate Queries Together
Hi,
I am trying to link two separate queries together in BIEE.
I have a query that will give me the sales value in January 2012 (monthly query)
But I would need to use the sales value of January 2012 to help derive the weekly sales value in another query (weekly query).
How would you link up two queries together?
I tried using union but it doesnt seem to be working.
Thanks.
BillHi Billy,
Sure, My pleasure. Here are the basic steps what you could go through.
1. Create an analysis with your Month (January) and Sales.
2. Save this analysis as Report1.
3. Create another analysis with Week and Sales.
4. Create a filter on column:Sales using the option 'Based on Another Analysis'. The analysis editor will provide you an option to browse your other analysis which you want this analysis to be based on and just click on this browse button, and navigate to and select Report1.
5. Once you have selected Report 1 through browse option, you get down in the same pop-up the relationship and use values in column.
So sample entries in this pop-up might look like
Column : Sales
Operator : is based on results of another analysis
Saved Analysis : /My Folder/Report1
Relationship : is equal than
Use values in Column : Sales
6. If you run this analysis, you could get all weekly sales figures which are equal to the january sales figures.
Hope this helps.
Thank you,
Dhar -
My wife and I have separate have separate user accounts on our IMac. We have separate Apple IDs for iTunes. How can we use iCloud on our separate iPhones without sharing contacts, calendars, etc.
If have separate iCloud accounts and want to keep your all your iCloud data separate, you can create separate user accounts for each of you, then sign into your individual iCloud account within your user account.
If you want to just add both iCloud calendars on your Mac, you can sign into one iCloud account in System Preferences>iCloud, then add the second account in System Preferences>Internet Accounts>iCloud and only check Calendars with this second account. -
Can I use accounts in the Airport Utility to keep backup from multiple macs separate and separate?
Backups from multiple Macs are always kept separate. Each Mac TM will create its own sparsebundle and will not interfere with others.
Using the accounts in AU will simply make each sparsebundle only accessible to that user.. ie it is a purely a security measure.. that is so weak as to be useless .. anyone can bypass it by pressing the reset for 1sec.
And what it will do is cut off everyone from their existing backups.. you will be warned when you set it up that what is about to happen may not be 100% goodness.. pay attention.. it is not. -
Create separate dynamic distribution groups for each UPNs domain
Hi All,
we have several UPNs in our Domain and need to create separate distribution groups for each UPNs.
the command that I used is,
new-dynamicdistributiongroup -name GroupName -RecipientFilter {(UserPrincipalName -like‘*@connect.test.local’)}
but this returns an error saying "Exception setting "RecipientFilter": "Invalid filter syntax"
what is the exact way of creating distribution group in O365 by filtering the UPN domain name?
Many thanksHi All,
we have several UPNs in our Domain and need to create separate distribution groups for each UPNs.
the command that I used is,
New-DynamicDistributionGroup -Name "All Students" -Alias "All_Students" -PrimarySmtpAddress "[email protected]" -RecipientFilter {(UserPrincipalName -like ‘*@connect.test.local’)}
new-dynamicdistributiongroup -name AllStudents -RecipientFilter {(UserPrincipalName -like '*@connect.test.local')} -
EA2: Worksheet not identifying separate queries properly.
Given the worksheet contents below, pressing F9 with the cursor in either of the queries starting on line 93 or 103) causes it to select everything from line 63 onwards as the current query.
There is a syntax error on line 81. If I fix that, the individual statements are select correctly.
SELECT target_name,
min(rollup_timestamp),
MIN ( value ) ,
MAX ( value ),
max(value)-min(value)
FROM
(SELECT ht.target_name ,
m.rollup_timestamp AS rollup_timestamp,
ROUND ( SUM ( maximum ) ) AS value
FROM mgmt$metric_daily m,
mgmt$target ht
WHERE
---ht.target_name='supled1-l.xxxxx.com' and
--ht.target_guid=??EMIP_BIND_TARGET_GUID?? and
ht.target_type ='host'
AND m.target_guid =ht.target_guid
AND m.metric_name ='Filesystems'
AND ( m.metric_column ='size' )
AND ( m.key_value IN ( '/u01', '/u02', '/u03', '/u04', '/u05', '/u06', '/u07', '/u08',
'/u09', '/u10', '/u11', '/u12', '/u13', '/u14', '/u15', '/u16',
'/u17', '/u18', '/u19', '/u20', '/u21', '/u22', '/backup',
'E:\','F:\','G:\','H:\','I:\','J:\','K:\','L:\','M:\','N:\') )
AND m.rollup_timestamp >= to_date('1-jan-2007','dd-mon-yyyy')
AND m.rollup_timestamp <= to_date('1-jan-2008','dd-mon-yyyy')
GROUP BY ht.target_name,
m.rollup_timestamp
--order by ht.target_name,m.rollup_timestamp
GROUP BY target_name
ORDER BY target_name;
SELECT target_name,
min(rollup_timestamp),
MIN ( value ) ,
MAX ( value ),
max(value)-min(value)
FROM
SELECT ht.target_name ,
sum(value)
FROM mgmt$metric_current m,
mgmt$target ht
WHERE
---ht.target_name='supled1-l.xxxx.com' and
--ht.target_guid=??EMIP_BIND_TARGET_GUID?? and
ht.target_type ='host'
AND m.target_guid =ht.target_guid
AND m.metric_name ='Filesystems'
AND ( m.metric_column ='size' )
AND ( m.key_value IN ( '/u01', '/u02', '/u03', '/u04', '/u05', '/u06', '/u07', '/u08',
'/u09', '/u10', '/u11', '/u12', '/u13', '/u14', '/u15', '/u16',
'/u17', '/u18', '/u19', '/u20', '/u21', '/u22', '/backup',
'E:\','F:\','G:\','H:\','I:\','J:\','K:\','L:\','M:\','N:\') )
group by ht.target_name
order by ht.target_name;
select distinct(key_value) from mgmt$metric_current where key_value like '_:\';
SELECT target_name,
min(rollup_timestamp),
MIN ( value ) ,
MAX ( value ),
max(value)-min(value)
FROM
(SELECT ht.target_name ,
m.rollup_timestamp AS rollup_timestamp,
ROUND ( SUM ( maximum ) ) AS value
FROM mgmt$metric_current m,
mgmt$target ht
WHERE
---ht.target_name='supled1-l.xxxxx.com' and
--ht.target_guid=??EMIP_BIND_TARGET_GUID?? and
ht.target_type ='host'
AND m.target_guid =ht.target_guid
AND m.metric_name ='Filesystems'
AND ( m.metric_column ='size' )
AND ( m.key_value IN ( 'E:\, '/u02', '/u03', '/u04', '/u05', '/u06', '/u07', '/u08', '/u09', '/u10', '/u11', '/u12', '/u13', '/u14', '/u15', '/u16', '/u17', '/u18', '/u19', '/u20', '/u21', '/u22', '/backup' )
AND m.rollup_timestamp >= to_date('1-jan-2007','dd-mon-yyyy')
AND m.rollup_timestamp <= to_date('1-jan-2008','dd-mon-yyyy')
GROUP BY ht.target_name,
m.rollup_timestamp
--order by ht.target_name,m.rollup_timestamp
GROUP BY target_name
ORDER BY target_name;
-- single server disk space.
SELECT rollup_timestamp,
SUM ( maximum )
FROM mgmt$metric_daily
WHERE target_name ='supled1-l.xxxxx.com'
AND metric_name ='Filesystems'
AND metric_column='size'
AND key_value IN ( '/u02', '/u03', '/u04', '/u05', '/u06', '/u07', '/u08', '/backup' )
GROUP BY rollup_timestamp
ORDER BY rollup_timestamp;
select
t.target_name,
sum(value)/1024
FROM
mgmt$metric_current m,
mgmt$target t
WHERE
t.target_guid in
select db.target_guid
from MGMT$TARGET_ASSOCIATIONS a, mgmt$target host, mgmt$target db
where host.target_name= 'supled1-l.xxxxx.com'
and a.source_target_type = 'oracle_database'
and a.assoc_target_name = host.TARGET_NAME
and host.TARGET_TYPE = 'host'
and a.source_target_name = db.TARGET_NAME
and db.TARGET_TYPE = 'oracle_database'
AND
(t.target_type='rac_database' OR
(t.target_type='oracle_database' AND t.TYPE_QUALIFIER3 != 'RACINST')) AND
m.target_guid=t.target_guid AND
m.metric_name='tbspAllocation' AND
m.metric_column='spaceAllocated' AND
GROUP BY t.target_name;Message was edited by:
smitjbAs soon as I pasted your statements into the worksheet, I could tell that there was a missing closing quote somewhere - gotta love that syntax highlighting. I would say that SQL Developer is working how I would want - all of your statement terminators between line 63 and the end are inside text strings (due to the missing quote on line 81), which means that everything from line 63 on is the one statement from a syntax perspective.
theFurryOne -
Create a subquery instead of executing two separate queries
Hi,
I need some help with creating a subquery from two different queries:
query 1 :
here pkey is jira key and I need to fetch component of a jira project
SELECT jiraissue.pkey, component.cname
FROM nodeassociation, component, jiraissue
WHERE component.ID = nodeassociation.SINK_NODE_ID
AND jiraissue.id = nodeassociation.SOURCE_NODE_ID
AND nodeassociation.ASSOCIATION_TYPE = 'IssueComponent'
AND pkey = 'abc-272';
result: project_key: abc-272
cname : def
query 2:
in the query I need to get a list of jira items by component, I have component name as 'def'and need to feed pkey as 'abc' means strip (-272) from abc-272.
Query : select jiraissue.*, co.*
from jiraissue,project,issuetype,nodeassociation,component,
customfieldvalue cv
,customfieldoption co
where
component.cname = 'def' and
project.pkey = 'abc' and
issuetype.pname = 'Bug' and
jiraissue.project = project.id and
jiraissue.issuetype = issuetype.id and
nodeassociation.association_type = 'IssueComponent' and
nodeassociation.source_node_entity = 'Issue' and
nodeassociation.source_node_id = jiraissue.id and
nodeassociation.sink_node_entity = 'Component' and
nodeassociation.sink_node_id = component.id
and jiraissue.id = cv.issue
and cv.stringvalue = co.id
and cv.customfield = 10020;
how can i make above as a subquery or execute everything in one query?Use Oracle function to strip the string e.g. 'XXX-YYY' will be pulled as 'XXX'
SQL> SELECT SUBSTR('abc-272',1,INSTR('abc-272','-',1,1) -1 )
2 FROM dual
3 /
SUBSTR('ABC-272',1,INSTR('ABC-
abc
-- Query
SELECT jiraissue., co.
FROM jiraissue,
project,
issuetype,
nodeassociation,
component,
customfieldvalue cv,
customfieldoption co
WHERE component.cname = 'def'
AND project.pkey = SUBSTR(jiraissue.pkey,1,INSTR(jiraissue.pkey,'-',1,1) - 1)
AND issuetype.pname = 'Bug'
AND jiraissue.project = project.id
AND jiraissue.issuetype = issuetype.id
AND nodeassociation.association_type = 'IssueComponent'
AND nodeassociation.source_node_entity = 'Issue'
AND nodeassociation.source_node_id = jiraissue.id
AND nodeassociation.sink_node_entity = 'Component'
AND nodeassociation.sink_node_id = component.id
AND jiraissue.id = cv.issue
AND cv.stringvalue = co.id
AND cv.customfield = 10020;
{code} -
Help me Join 2 separate queries
SQL> select op_date, sum(withdrawal) withdrawal, sum(deposit) deposit from (
2 select op_date_frm op_date, null withdrawal, op_amount deposit
3 from op_bal
4 union all
5 select op_date_frm op_date,sum(DECODE(EXPN_EI,'E',EXN_AMOUNT)) WITHDRAWAL,
6 sum(DECODE(EXPN_EI,'I',EXN_AMOUNT)) DEPOSIT
7 from EXPENSES_TXN, expense_master
8 where exn_acnt_code = expn_code
9 and exn_date < to_date('01/04/2009','dd/mm/yyyy'))
10 group by op_date
11 /
OP_DATE WITHDRAWAL DEPOSIT
01-APR-09 2045.000 6200.000
SQL> SELECT OP_DATE,TNO,OP_CODE,EI,WITHDRAWAL,DEPOSIT,
2 sum(NVL(DEPOSIT,0)-NVL(WITHDRAWAL,0)) over (order by op_date,tno) bal
3 FROM (SELECT OP_DATE,NULL TNO,OP_CODE,NULL EI,NULL WITHDRAWAL,OP_AMOUNT DEPOSIT
4 FROM OP_BAL
5 UNION ALL
6 SELECT
7 EXN_DATE,
8 EXN_NO,
9 EXN_ACNT_CODE,
10 EXPN_EI,
11 DECODE(EXPN_EI,'E',EXN_AMOUNT) WITHDRAWAL,
12 DECODE(EXPN_EI,'I',EXN_AMOUNT) DEPOSIT
13 FROM EXPENSES_TXN, EXPENSE_MASTER
14 WHERE EXN_ACNT_CODE = EXPN_CODE
15 order by 1) a
16 WHERE OP_DATE between to_date('01/04/2009','dd/mm/yyyy') and to_date('30/4/2009','dd/mm/yyyy')
17 order by op_date
18 /
OP_DATE TNO OP_COD E WITHDRAWAL DEPOSIT BAL
01-APR-09 9.000 AC0013 I 250.000 250.000
07-APR-09 1.000 AC0001 E 200.000 50.000
09-APR-09 3.000 AC0003 E 50.000 .000
09-APR-09 4.000 AC0011 E 35.000 -35.000
should give me this result;
OP_DATE TNO OP_COD E WITHDRAWAL DEPOSIT BAL
01-APR-09 OP0000 2045.000 6200.000 4155.000
01-APR-09 9.000 AC0013 I 250.000 4405.000
07-APR-09 1.000 AC0001 E 200.000 4205.000
09-APR-09 4.000 AC0011 E 35.000 4170.000
09-APR-09 3.000 AC0003 E 50.000 4120.000i nearly solved it, stuck at order by,,please help
select rownum rn, op_date, TNO,OP_CODE,EI,withdrawal,deposit,
sum(NVL(DEPOSIT,0)-NVL(WITHDRAWAL,0)) over (order by op_date,tno) bal
from
select op_date, NULL TNO,null OP_CODE,NULL EI,withdrawal,deposit
from
select to_date('01/04/2009','dd/mm/yyyy') op_date, sum(withdrawal) withdrawal, sum(deposit) deposit
from
select op_date, null withdrawal, op_amount deposit
from op_bal
union all
select to_date('01/04/2009','dd/mm/yyyy') op_date,sum(DECODE(EXPN_EI,'E',EXN_AMOUNT)) WITHDRAWAL,
sum(DECODE(EXPN_EI,'I',EXN_AMOUNT)) DEPOSIT
from EXPENSES_TXN, expense_master
where exn_acnt_code = expn_code
and exn_date < to_date('01/04/2009','dd/mm/yyyy'))
union all
SELECT
EXN_DATE,
EXN_NO,
EXN_ACNT_CODE,
EXPN_EI,
DECODE(EXPN_EI,'E',EXN_AMOUNT) WITHDRAWAL,
DECODE(EXPN_EI,'I',EXN_AMOUNT) DEPOSIT
FROM EXPENSES_TXN, EXPENSE_MASTER
WHERE EXN_ACNT_CODE = EXPN_CODE
and EXN_DATE between to_date('01/04/2009','dd/mm/yyyy') and to_date('30/4/2009','dd/mm/yyyy'))
order by op_date,rn
RN OP_DATE TNO OP_COD E WITHDRAWAL DEPOSIT BAL
1.000 01-APR-09 2045.000 6200.000 4405.000 <<----NOT doing Summ properly
5.000 01-APR-09 9.000 AC0013 I 250.000 250.000
2.000 07-APR-09 1.000 AC0001 E 200.000 4205.000
3.000 09-APR-09 3.000 AC0003 E 50.000 4155.000
4.000 09-APR-09 4.000 AC0011 E 35.000 4120.000
earlier with another query i got this result;
select op_date, TNO,OP_CODE,EI,withdrawal,deposit,
sum(NVL(DEPOSIT,0)-NVL(WITHDRAWAL,0)) over (order by op_date) bal
from
select op_date, NULL TNO,null OP_CODE,NULL EI,withdrawal,deposit
from
select to_date('01/04/2009','dd/mm/yyyy') op_date, sum(withdrawal) withdrawal, sum(deposit) deposit
from
select to_date('01/04/2009','dd/mm/yyyy') op_date,sum(DECODE(EXPN_EI,'E',EXN_AMOUNT)) WITHDRAWAL,
sum(DECODE(EXPN_EI,'I',EXN_AMOUNT)) DEPOSIT
from EXPENSES_TXN, expense_master
where exn_acnt_code = expn_code
and exn_date < to_date('01/04/2009','dd/mm/yyyy')
union all
select op_date, null withdrawal, op_amount deposit
from op_bal))
union all
SELECT
EXN_DATE,
EXN_NO,
EXN_ACNT_CODE,
EXPN_EI,
DECODE(EXPN_EI,'E',EXN_AMOUNT) WITHDRAWAL,
DECODE(EXPN_EI,'I',EXN_AMOUNT) DEPOSIT
FROM EXPENSES_TXN, EXPENSE_MASTER
WHERE EXN_ACNT_CODE = EXPN_CODE
and EXN_DATE between to_date('01/04/2009','dd/mm/yyyy') and to_date('30/4/2009','dd/mm/yyyy'))
order by op_DATE
OP_DATE TNO OP_COD E WITHDRAWAL DEPOSIT BAL
01-APR-09 2045.000 6200.000 4405.000
01-APR-09 9.000 AC0013 I 250.000 4405.000
07-APR-09 1.000 AC0001 E 200.000 4205.000
09-APR-09 4.000 AC0011 E 35.000 4120.000 <<---- tno 4 should be after 3
09-APR-09 3.000 AC0003 E 50.000 4120.000 -
Separate Queries Refresh with Append?
Hello All
Say we have a data model built from 3 different sources:
1) Historical data from a big Access file (7+ million rows, set to never refresh in the data connections)
2) Daily updates csv folder (8k rows daily files, set to combine & refresh on file open)
3) Current csv file (an 8k rows file, set to refresh every 30 mins)
We built a query from all of them appending them all. But there is a refresh problem: if we need the last 30 mins included in all the data, the query is currently refreshing all of them, making it super slow/inefficient.
What we´re looking is to have all historical data till now (with no more than 30 mins delay), but without the need to refresh all the data every 30 mins... just the needed part, which is the 3rd: the current csv file with 8k rows only.
Is this possible? and how?
Thanks so much for your support. You´re doing an outstanding work. :)Hi Nico,
By appending these three queries into one, all refresh operations on the final query will result in upstream dependencies being refreshed as well. There is no way to work around that.
If the tables were of a relatively small size, one "hacky" way of controlling this behavior would be to load the three queries into the worksheet, and then using Power Query's "From Table" to connect to the three output tables and append these tables instead
of the original queries. That way, you'd pick the latest data available on the sheet, which would be refreshed according to the rules that you defined above.
Given that your source #1 is 7+ million rows, this won't fit in the worksheet so this suggestion won't work for you. I think you should look into ways of decoupling this table from the other two, and have them loaded separately into the Data Model if possible.
Alternatively, maybe having this database file sitting locally would improve the load time?
Hope this helps.
Thanks,
M. -
Group By Column using Wizard - Begin each group on new page...?
I have a report w/ just one query, and I'm using the wizard to designate a column by which to group the data. What I need to do is begin each new group on a new page. I can do this by setting the region for my grouped field header as 'Yes' for Page Break Before, but that always creates a blank page as the very first page of the report.
Is there an easier way for me to do this?Yes -
Set the Maximum Rows per page to 1 for the repeating group which you want to separate.
For example if you had a list of employees grouped by department, if you set that property on the repeating frame for the department frame, each department would appear on a separate page.
Thats a confusing thing to new users of Reports :) -
Asset class Land separate & building separate ( for 1 asset)
Warm Greetings to All Group Members
Require Best practice solution
Current Scenario Our company Purchased the building in 2009 and In SAP system Building was created, posted to asset class Building with the depreciation for 40 Years
Our Audit department is requesting our Finance department to show two assets separate as
1) land with useful life 40 Years with value
2) Building with useful life Zero with value
Note
current The posted asset in sap Has value ( Building + land)
2.Our company is state transport company
Please suggest me/as what is the best practice
Should i create a new asset class separate as land and move the value of building to land
Your Early Reply will be appreciated
regards
shamul heqHi Shamul heq
If you want to manage land and building separately, you need to create new asset class for land beside asset class for building. Then create new land asset master data under land asset class and transfer value of the land from original building asset to newly created land asset.
Alternatively, case of no necessary to manage land seperately, you can simply transfer the value of land to sub-number asset of the building asset. In this way, you can manage the building and the land as one asset in SAP system.
Regards
George -
Syncing separate phones, separate contacts in Outlook
My wife and I each have an iphone.
I synced with outlook for my contacts, and I've got all my contact info there, but we have separate profiles on outlook, with separate e-mail accounts and separate contacts.
I can't differentiate how to sync my iphone with my outlook profile and my contacts, and her iphone with her outlook profile, which will hold her contacts.Let me amplify what I posted earlier. I do not see any way that Itunes will let you choose a profile. The only way it will work is with separate user accounts.
You need to set up two user accounts on your windows machine, one for you and one for your wife. If this is a new login, Outlook will not know anything. You will need to create a profile, associate it with your email, and make your existing Outlook file the default data file. Start iTunes and it should see this profile as the one it will use for mail, contacts, and calendar.
Do the same thing with your wife's login. It is a little work, and you may have to deal with where common files, like music, is kept so that each iTunes setup can see them. -
Keeping ITunes Separate on Separate computers
Been running iTunes for years on my Mac(s).
Got a used Lenovo to code VBA macros for work.
Added iTunes for podcasts I don't watch at my desk: Like TED.
With the last iTunes: suddenly my Mac Library & Playlist shows up on the Laptop.
Not the desired result.
I have 2 iPods [classics] and wish to sync one with the Lenovo and the other, as usual, with my Mac.
There is only one account. I have nothing on Cloud.
Where do I find out how to keep the Libraries Separate |
(Don't wish to delete all the unwanted podcasts (or library entries) from the laptop and then find out they are gone from my main Mac)
No way is there enough room on my Laptop for the iTunes Library that's on the Mac.
TIA
-wbajr tbc
iTunes 11.1.0.126
Home Sharing is off. Seems to affect Podcast List & not music.
Sorry if this is in the wrong forum.Not that I know of.
The download of my complete iPod subscription list occurred with the
11.1.0.126 on a PC & Same Latest for Mac
iCloud was down loaded as part of the PC Apple Update but I deleted the iCloud app on the PC after it was installed. This (duplicate podcast listings) could have happened before I deleted it. Sorry, not ready for cloud since I don't have any other apple products orther the the iPod & the Desktop Macs.
PC development items cannot go to the cloud..company policy for the type of work.
Never subscribed to iCloud.
So: if there is no iCloud link on my PC Laptop: is it safe to delete the unwanted Pod Cast Entries on the PC and not have them deleted from the Mac?
Looks like I need to do some homework on iTunes Match and iCloud ;-)
-wbajr tbc -
Long Running Queries Using Group By & Order By
I have his query and it takes forever to run. The TABLE 'term' has over a million rows and I think that the 'group by' and the 'Order By' together is killing the execution...
Or is it due to the compute clauses.. I am at loss to understand the whole issue..
Any ideas or thougts on how to solve this issue. Oracle Version is 8.1.6 ...
Please help !!!!
Thanx
Rama
====================
set pages 10000;
set heading on;
compute sum of total on area
compute sum of total on report
break on area skip 2 on report
SELECT c.area area
, b.modelcode model
, count(1) total
FROM leadterm a
,lead e
,term b
,temp_veh b
,leaddealer d
,dealer c
WHERE
a.leadid not in (select leadid from leadno_tmp)
and a.leadid = e.leadid
and a.termid = b.termid
and e.leaddealerid = d.leaddealerid
and ltrim(rtrim(d.vwdealercode)) = ltrim(rtrim(c.dealercode))
group by c.area
, b.modelcode
order by to_number(c.area)
, b.modelcode
exit;Did you run this query through the explain plan yet?
A few thoughts:
- Order by is not needed, since group by automatically sorts the records.
- Assuming that dealercode is a primary key, ltrim and rtrim functions will cause Oracle NOT to use indexes, but a full table scan. If a foreign key is defined, then ltrim and rtrim should not be necessary at all.
- Instead of "not in" use "where not exists"
Maybe you are looking for
-
MSS General Information - Personal Data Iview
Hi, On Mss> Team > General Information, We want to add to Personal Data Iview more fields, for example secondary address, We dont have NWDI, so I'm looking for some table to customize an add the parameters.... Any help? Thanks in advanced!
-
Using external LDAP to create a web server
Hello everyone, I am working on a project for the university I work for. We have an iPlanet LDAP server that contains the identities of everyone (faculty, staff, students). I have set up an experimental OS X server that we'd like to play with; in par
-
How to create dynamic screen using module pool programming
Hi, Could anybody help me how to create dynamic screens? I am developing a screen with HR Person with assignment info. If PERNR have multiple assignments, i need to show all the details one by one. How to show the details on screen. I need to call on
-
Hi all, Good day,I need your help. I am really new to APEX. I would like to have a user table name 'tbl_user' with 2 columns (user_id, password). Some dummy data were created, and I do some PL/SQL coding inside the default login page of a newly creat
-
I cannot get any of the files to open up in elements. I get an error message and it closes