Please reply to this query asap
Create a matrix query to display the job,salary for that job based on department number and the total salary for that job for all departments,giving each column an app: heading
JOB DEPTNO(10) 20 30 SUM(SAL)
ANALYST 0 100 0 100
SALARY AND JOB AND DEPTNO ARE IN EMP TABLE
If you want to pivot your emp table, use the forum's search function for some examples, such as this thread:
Re: pivot query
C.
Similar Messages
-
A Lot of Question: PLEASE REPLY TO THIS THREAD
Hi, I am a 16 year old teen that is about to wait for the right moment to have my dream of starting a youtube channel. Ive done a lot of research comparing how any type of laptop will compare when I record and play my games, because i mostly want to get into gaming youtube channel. Although i might want to do just gaming ive also wanted to do videos of unboxing and music covers. My friend that knows a lot about computers told me that i should get a mac if i want to do mainly editing, or if i want to just game and record i should buy a pc laptop. He recommended that i should buy a laptop from IBUYPOWER that has better specs than that of the mac book pro retina 15" and is cheaper. That moves onto my next question asking why are macs so overpriced? I did all my research on that too, and it most likely seems it is almost a brand name expense like louis vuotton. Next question is, how is the cheapest way I can get the 15" retina mac book pro for the cheapest price possible, should i wait until black friday for sales to lower, or should i wait until the next year to get the next 2015 model. Is the newer progressing years of MacBook pros that much better that i should wait until the next year to get it. Next question, say i wanted to play a game that is only on windows platform, ex. Skyrim. Should i play a cracked version that has been reformatted to the mac, or should i just download windows on my mac so that i can play it with more ease of use that way, instead of having to use everything in the mac side when it was originally formatted for Windows. Anyway thank you for your time, and even if you dont know the answer to these questions, PLEASE ANSWER ANYWAY, THANK YOU!
MacBook Pro with Retina display, PLEASE REPLY TO THIS THREADyellowfelow wrote:
That moves onto my next question asking why are macs so overpriced?
There is no such thing as overpriced. Apple is the most profitable company in the world. It sells all of the Macs it makes - every single one. Not everyone can afford a Mac, but such is life.
I did all my research on that too, and it most likely seems it is almost a brand name expense like louis vuotton.
That is incorrect. According to Forbes, Apple is the #1 most valuable brand, while Louis Vuitton is #10.
Next question is, how is the cheapest way I can get the 15" retina mac book pro for the cheapest price possible, should i wait until black friday for sales to lower, or should i wait until the next year to get the next 2015 model.
Machines may get more powerful every year, but they never get cheaper. You may be able to save more money the longer you wait. If you can't afford a 15" retina, consider a refurbished unit (buy directly from Apple only - see babowa's link), a 13" model, or an Air.
Is the newer progressing years of MacBook pros that much better that i should wait until the next year to get it.
They get better every year. If you wait forever, then the machine you never buy will be infinitely powerful.
Next question, say i wanted to play a game that is only on windows platform, ex. Skyrim. Should i play a cracked version that has been reformatted to the mac, or should i just download windows on my mac so that i can play it with more ease of use that way, instead of having to use everything in the mac side when it was originally formatted for Windows.
There is no such think as a "cracked version that has been reformatted to the Mac". If you want to run Windows software, buy a PC and run Windows. Most people do. You may be able to play that game on a Mac using Bootcamp, but it isn't guaranteed. -
All who replied to my earlier questions please reply to this thread ?
hi, i have posted many questions and got them answered correctly. The members who replied to my questions posted previously,please reply to this post as "hi" or even an empty message. I want to add as many dukestars as possible for them. I am so sorry that i havent even responded or thanked anyone who provided the correct answers or replied to my post. So atleast let me add some duke stars for you. I remember the members who replied me. Thank you so much.Please provide me an opportunity to serve you.
Thank YouYour 23 posts are all here: [~suryakiran_s]. Award them there.
-
Please reply to this basic question....
i am using java version 1.4.1
In java home directory it contains bin and jre forlders.
In both of the folders java.exe file is there.
What is the use of having the same file in both directiory......
Please reply to this basic question....One probaly came with the JDK, and one came with the complete JRE that's included in the JDK...
-
Can somebody please simplify/tune this query?
Hi,
Can somebody please simplify this query?
It's a little urgent. Currently this query is taking 10 mins to run.
Thank you so much,
vasu
Purpose:
First Child Case Ind =
Get Parent Case for this case.
Get all child cases for this parent case.
Arrange them in ascending order by create Date.
If the first case (eldest case) is the case in question,
then Y
else N
Query:
SELECT THIS_CASE.OBJID THIS_CASE_OBJID,
PARENT.PARENT_OBJID,
(CASE
WHEN PARENT.FIRST_CHILD_OBJID = THIS_CASE.OBJID
THEN 'Y'
ELSE 'N'
END) IS_FIRST_CHILD_CASE
FROM SA.TABLE_CASE THIS_CASE,
(SELECT PARENT_OBJID,
CHILD_OBJID FIRST_CHILD_OBJID
FROM (SELECT PARENT_CASE.OBJID PARENT_OBJID,
CHILD_CASE.OBJID CHILD_OBJID,
CHILD_CASE.CREATION_TIME,
ROW_NUMBER() OVER (PARTITION BY PARENT_CASE.OBJID
ORDER BY CHILD_CASE.CREATION_TIME ASC) ROW_NUM
FROM SA.TABLE_CASE PARENT_CASE,
SA.TABLE_CASE CHILD_CASE
WHERE PARENT_CASE.OBJID = CHILD_CASE.CASE_VICTIM2CASE
WHERE ROW_NUM = 1
) PARENT
WHERE THIS_CASE.CASE_VICTIM2CASE = PARENT.PARENT_OBJID(+)Thank you for the quick reply.
Here is the explain plan:
Operation Object Name Rows Bytes Cost
SELECT STATEMENT Optimizer Mode=CHOOSE 2 M 32831
HASH JOIN OUTER 2 M 130 M 32831
TABLE ACCESS FULL SA.TABLE_CASE 2 M 24 M 21550
VIEW 307 K 11 M 10130
WINDOW SORT PUSHED RANK 307 K 7 M 10130
MERGE JOIN 307 K 7 M 8666
TABLE ACCESS BY INDEX ROWID SA.TABLE_CASE 307 K 4 M 1266
INDEX FULL SCAN SA.IND_CASE_VICTIM2CASE 307 K 738
SORT JOIN 2 M 19 M 7400
INDEX FAST FULL SCAN SA.PK_TABLE_CASE 2 M 19 M 785
Please let me know.
Thank you. -
Please Suggest on this(Query Designer)
Hi ALL,
I want to design reports from one Query as shown below other
Cost of setup
(In US$)
Items Market Price Discount
Construction cost 10 8
Building cost 20 18
Land Cost 30 28
Material Cost 40 38
Total 100 90
Cost of setup
(In INR )
Items Market Price Discount
Construction cost 10 8
Building cost 20 18
Land Cost 30 28
Material Cost 40 38
Total 100 90
Please Suggest on this.
Thanks & Regards
Sameer KhanHi ALL,
I want to design reports from one Query as shown below other
Cost of setup
(In US$)
Items -
Market Price----
Discount
Construction cost----
10 -
8
Building cost -
20 -
18
Land Cost -
30 -
28
Material Cost -
40 -
38
Total -
100 -
90
Cost of setup
(In INR )
Items -
Market Price----
Discount
Construction cost----
10 -
8
Building cost -
20 -
18
Land Cost -
30 -
28
Material Cost -
40 -
38
Total -
100 -
90
Please Suggest on this.
Thanks & Regards
Sameer Khan -
Can you please explain how this query is fetching the rows?
here is a query to find the top 3 salaries. But the thing is that i am now able to understand how its working to get the correct data :How the data in the alias table P1 and P2 getting compared. Can you please explain in some steps.
SELECT MIN(P1.SAL) FROM PSAL P1, PSAL P2
WHERE P1.SAL >= P2.SAL
GROUP BY P2.SAL
HAVING COUNT (DISTINCT P1.SAL) <=3 ;
here is the data i used :
SQL> select * from psal;
NAME SAL
able 1000
baker 900
charles 900
delta 800
eddy 700
fred 700
george 700
george 700
Regards,
Renu... Please help me in understanding the query.
Your query looks like anything but a Top-N query.
If you run it in steps and analyze the output at the end of each step, then you should be able to understand what it does.
Given below is some brief information on the same:
test@ora>
test@ora> --
test@ora> -- Query 1 - using the non-equi (theta) join
test@ora> --
test@ora> with psal as (
2 select 'able' as name, 1000 as sal from dual union all
3 select 'baker', 900 from dual union all
4 select 'charles', 900 from dual union all
5 select 'delta', 800 from dual union all
6 select 'eddy', 700 from dual union all
7 select 'fred', 700 from dual union all
8 select 'george', 700 from dual union all
9 select 'george', 700 from dual)
10 --
11 SELECT p1.sal AS p1_sal, p1.NAME AS p1_name, p2.sal AS p2_sal,
12 p2.NAME AS p2_name
13 FROM psal p1, psal p2
14 WHERE p1.sal >= p2.sal;
P1_SAL P1_NAME P2_SAL P2_NAME
1000 able 1000 able
1000 able 900 baker
1000 able 900 charles
1000 able 800 delta
1000 able 700 eddy
1000 able 700 fred
1000 able 700 george
1000 able 700 george
900 baker 900 baker
900 baker 900 charles
900 baker 800 delta
900 baker 700 eddy
900 baker 700 fred
900 baker 700 george
900 baker 700 george
900 charles 900 baker
900 charles 900 charles
900 charles 800 delta
900 charles 700 eddy
900 charles 700 fred
900 charles 700 george
900 charles 700 george
800 delta 800 delta
800 delta 700 eddy
800 delta 700 fred
800 delta 700 george
800 delta 700 george
700 eddy 700 eddy
700 eddy 700 fred
700 eddy 700 george
700 eddy 700 george
700 fred 700 eddy
700 fred 700 fred
700 fred 700 george
700 fred 700 george
700 george 700 eddy
700 george 700 fred
700 george 700 george
700 george 700 george
700 george 700 eddy
700 george 700 fred
700 george 700 george
700 george 700 george
43 rows selected.
test@ora>
test@ora>This query joins PSAL with itself using a non equi-join. Take each row of PSAL p1 and see how it compares with PSAL p2. You'll see that:
- Row 1 with sal 1000 is >= to all sal values of p2, so it occurs 8 times
- Row 2 with sal 900 is >= to 9 sal values of p2, so it occurs 7 times
- Row 3: 7 times again... and so on.
- So, total no. of rows are: 8 + 7 + 7 + 5 + 4 + 4 + 4 + 4 = 43
test@ora>
test@ora> --
test@ora> -- Query 2 - add the GROUP BY
test@ora> --
test@ora> with psal as (
2 select 'able' as name, 1000 as sal from dual union all
3 select 'baker', 900 from dual union all
4 select 'charles', 900 from dual union all
5 select 'delta', 800 from dual union all
6 select 'eddy', 700 from dual union all
7 select 'fred', 700 from dual union all
8 select 'george', 700 from dual union all
9 select 'george', 700 from dual)
10 --
11 SELECT p2.sal AS p2_sal,
12 COUNT(*) as cnt,
13 COUNT(p1.sal) as cnt_p1_sal,
14 COUNT(DISTINCT p1.sal) as cnt_dist_p1_sal,
15 MIN(p1.sal) as min_p1_sal,
16 MAX(p1.sal) as max_p1_sal
17 FROM psal p1, psal p2
18 WHERE p1.sal >= p2.sal
19 GROUP BY p2.sal;
P2_SAL CNT CNT_P1_SAL CNT_DIST_P1_SAL MIN_P1_SAL MAX_P1_SAL
700 32 32 4 700 1000
800 4 4 3 800 1000
900 6 6 2 900 1000
1000 1 1 1 1000 1000
test@ora>
test@ora>Now, if you group by p2.sal in the output of query 1, and check the number of distinct p1.sal, min of p1.sal etc. you see that for p2.sal values - 800, 900 and 1000, there are 3 or less p1.sal values associated.
So, the last 3 rows are the ones you are interested in, essentially. As follows:
test@ora>
test@ora> --
test@ora> -- Query 3 - GROUP BY and HAVING
test@ora> --
test@ora> with psal as (
2 select 'able' as name, 1000 as sal from dual union all
3 select 'baker', 900 from dual union all
4 select 'charles', 900 from dual union all
5 select 'delta', 800 from dual union all
6 select 'eddy', 700 from dual union all
7 select 'fred', 700 from dual union all
8 select 'george', 700 from dual union all
9 select 'george', 700 from dual)
10 --
11 SELECT p2.sal AS p2_sal,
12 COUNT(*) as cnt,
13 COUNT(p1.sal) as cnt_p1_sal,
14 COUNT(DISTINCT p1.sal) as cnt_dist_p1_sal,
15 MIN(p1.sal) as min_p1_sal,
16 MAX(p1.sal) as max_p1_sal
17 FROM psal p1, psal p2
18 WHERE p1.sal >= p2.sal
19 GROUP BY p2.sal
20 HAVING COUNT(DISTINCT p1.sal) <= 3;
P2_SAL CNT CNT_P1_SAL CNT_DIST_P1_SAL MIN_P1_SAL MAX_P1_SAL
800 4 4 3 800 1000
900 6 6 2 900 1000
1000 1 1 1 1000 1000
test@ora>
test@ora>
test@ora>That's what you are doing in that query.
The thing is - in order to find out Top-N values, you simply need to scan that one table PSAL. So, joining it to itself is not necessary.
A much simpler query is as follows:
test@ora>
test@ora>
test@ora> --
test@ora> -- Top-3 salaries - distinct or not; using ROWNUM on ORDER BY
test@ora> --
test@ora> with psal as (
2 select 'able' as name, 1000 as sal from dual union all
3 select 'baker', 900 from dual union all
4 select 'charles', 900 from dual union all
5 select 'delta', 800 from dual union all
6 select 'eddy', 700 from dual union all
7 select 'fred', 700 from dual union all
8 select 'george', 700 from dual union all
9 select 'george', 700 from dual)
10 --
11 SELECT sal
12 FROM (
13 SELECT sal
14 FROM psal
15 ORDER BY sal DESC
16 )
17 WHERE rownum <= 3;
SAL
1000
900
900
test@ora>
test@ora>
test@ora>And for Top-3 distinct salaries:
test@ora>
test@ora> --
test@ora> -- Top-3 DISTINCT salaries; using ROWNUM on ORDER BY on DISTINCT
test@ora> --
test@ora> with psal as (
2 select 'able' as name, 1000 as sal from dual union all
3 select 'baker', 900 from dual union all
4 select 'charles', 900 from dual union all
5 select 'delta', 800 from dual union all
6 select 'eddy', 700 from dual union all
7 select 'fred', 700 from dual union all
8 select 'george', 700 from dual union all
9 select 'george', 700 from dual)
10 --
11 SELECT sal
12 FROM (
13 SELECT DISTINCT sal
14 FROM psal
15 ORDER BY sal DESC
16 )
17 WHERE rownum <= 3;
SAL
1000
900
800
test@ora>
test@ora>
test@ora>You may also want to check out the RANK and DENSE_RANK analytic functions.
RANK:
http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/functions123.htm#SQLRF00690
DENSE_RANK:
http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/functions043.htm#SQLRF00633
HTH
isotope -
Plz help me this query:
Create a query that displays the employees last name and indicates the amounts of their annual salaries with *. Each * signifies a thousand $'s.
EG. If the salary of an employee with last name king is 2000 then it should appear as follows:
King **
2 (*) for 2 thousand.
Thanks in advanceHi,
I was able to solve this query on my own. For those who might face a problem in future the solutionto it is:
SELECT rpad(last_name, length(last_name) + (salary/1000), '*') AS employee_and_their_salaries
FROM employees;
Thanks -
Kindly reply to this scenario ASAP.
Respected Gurrs,
In the following code data frm LFA1 is not retrieved.Can anybody tell me where is the prob in my code here? Kindly help n reply ASAP.
thanks and reagrds,
SELECT SINGLE lifnr ebeln mblnr FROM mseg into itab_mseg
WHERE mblnr = mblnr.
zmmrej-grndoc_no = itab_mseg-mblnr.
zmmrej-pono = itab_mseg-ebeln.
zmmrej-vendor = itab_mseg-lifnr.
SELECT SINGLE budat bktxt FROM mkpf INTO itab_mkpf WHERE mblnr = ITAB_MSEG-mblnr.
zmmrej-grn_date = itab_mkpf-budat .
zmmrej-grn_nos = itab_mkpf-bktxt.
SELECT SINGLE name1 stras ort01 pstlz FROM lfa1 INTO itab_lfa1 WHERE LIFNR = i_mseg-LIFNR.
zmmrej-vendname = itab_lfa1-name1.
zmmrej-vendadd1 = itab_lfa1-stras.
zmmrej-venadd2 = itab_lfa1-ort01.
zmmrej-venadd3 = itab_lfa1-pstlz.Dear Sudha,
Your query is locked. Please use the relevant subject line.
Regards,
Rakesh
Moderator -
Please reply for the query tuning
Hi, i am a beginner in oracle dba, I have to know if i have studied little bit about query tuning in ORACLE.
I wanna know if i have the following query and its plan then how it can be tuned:
QUERY:
SELECT z.emplid ,h.first_name || ' ' || h.last_name ,z.grade ,z.DEPTID ,z.LOCATION
FROM sysadm.ps_lnt_latestbu_vw z, sysadm.ps_personal_data h
WHERE z.empl_status ='A' --index access
AND z.emplid = h.emplid --join
and z.emplid not in (select g.emplid from sysadm.ps_lnt_asn_skl_tbl g) --join
and z.Business_unit=
( select l.lnt_subunit from sysadm.ps_position_data l where l.position_nbr in
( select b.position_nbr from sysadm.ps_job b,sysadm.psoprdefn y
where b.effdt=( select max(g.effdt) from sysadm.ps_job g
where g.emplid=b.emplid --join costs high
and g.effdt<=SYSDATE) --filter/index
and b.effseq=
(select max(h.effseq) from sysadm.ps_job h
where h.emplid=b.emplid --join costs high
and h.effdt=b.effdt) --join costs high
and b.empl_rcd=0 --filter/index access
and y.EMPLID=b.EMPLID --join
and y.OPRID='1112' -- filter/index access
order by z.emplid
/AND its plan is:
Execution Plan
0 SELECT STATEMENT Optimizer=CHOOSE (Cost=6 Card=1 Bytes=64)
1 0 SORT (ORDER BY) (Cost=6 Card=1 Bytes=64)
2 1 NESTED LOOPS (ANTI) (Cost=4 Card=1 Bytes=64)
3 2 NESTED LOOPS (Cost=3 Card=1 Bytes=56)
4 3 VIEW OF 'PS_LNT_LATESTBU_VW' (Cost=2 Card=1 Bytes=31)
5 4 UNION-ALL
6 5 CONCATENATION
7 6 TABLE ACCESS (BY INDEX ROWID) OF 'PS_POSITION_DATA' (Cost=5 Card=90 Bytes=1890)
8 7 NESTED LOOPS
9 8 NESTED LOOPS (Cost=275 Card=1 Bytes=90)
10 9 NESTED LOOPS (Cost=275 Card=1 Bytes=82)
11 10 TABLE ACCESS (BY INDEX ROWID) OF 'PS_JOB' (Cost=3 Card=1 Bytes=50)
12 11 INDEX (RANGE SCAN) OF 'PS2JOB' (NON-UNIQUE) (Cost=2 Card=1)
13 12 SORT (AGGREGATE)
14 13 FIRST ROW (Cost=3 Card=1 Bytes=19)
15 14 INDEX (RANGE SCAN (MIN/MAX)) OF 'PSAJOB' (NON-UNIQUE) (Cost=3 Card=207700)
16 12 SORT (AGGREGATE)
17 16 FIRST ROW (Cost=3 Card=1 Bytes=22)
18 17 INDEX (RANGE SCAN (MIN/MAX)) OF 'PSAJOB' (NON-UNIQUE) (Cost=3 Card=207700)
19 10 INDEX (UNIQUE SCAN) OF 'PS_EMPLOYMENT'(UNIQUE)
20 9 INDEX (UNIQUE SCAN) OF 'PS_PERSONAL_DATA' (UNIQUE)
21 8 INDEX (RANGE SCAN) OF 'PS_POSITION_DATA' (UNIQUE) (Cost=5 Card=90)
22 6 FILTER
23 22 NESTED LOOPS (Cost=275 Card=1 Bytes=90)
24 23 NESTED LOOPS (Cost=275 Card=1 Bytes=82)
25 24 NESTED LOOPS (Cost=275 Card=1 Bytes=71)
26 25 INDEX (FAST FULL SCAN) OF 'PS8POSITION_DATA' (NON-UNIQUE) (Cost=5 Card=90 Bytes=1890)
27 25 TABLE ACCESS (BY INDEX ROWID) OF 'PS_JOB' (Cost=3 Card=1 Bytes=50)
28 27 INDEX (RANGE SCAN) OF 'PS2JOB' (NON-UNIQUE) (Cost=2 Card=1)
29 28 SORT (AGGREGATE)
30 29 FIRST ROW (Cost=3 Card=1 Bytes=22)
31 30 INDEX (RANGE SCAN (MIN/MAX)) OF 'PSAJOB' (NON-UNIQUE) (Cost=3 Card=207700)
32 28 SORT (AGGREGATE)
33 32 FIRST ROW (Cost=3 Card=1 Bytes=19)
34 33 INDEX (RANGE SCAN (MIN/MAX)) OF 'PSAJOB' (NON-UNIQUE) (Cost=3 Card=207700)
35 24 INDEX (UNIQUE SCAN) OF 'PS_EMPLOYMENT' (UNIQUE)
36 23 INDEX (UNIQUE SCAN) OF 'PS_PERSONAL_DATA'(UNIQUE)
37 22 SORT (AGGREGATE)
38 37 FIRST ROW (Cost=2 Card=1 Bytes=17)
39 38 INDEX (RANGE SCAN (MIN/MAX)) OF 'PS_POSITION_DATA' (UNIQUE) (Cost=2 Card=9000)
40 5 FILTER
41 40 NESTED LOOPS (Cost=751 Card=1 Bytes=191)
42 41 NESTED LOOPS (OUTER) (Cost=750 Card=1 Bytes=167)
43 42 NESTED LOOPS (OUTER) (Cost=749 Card=1 Bytes=143)
44 43 NESTED LOOPS (Cost=748 Card=1 Bytes=134)
45 44 NESTED LOOPS (Cost=748 Card=1 Bytes=123)
46 45 NESTED LOOPS (Cost=748 Card=1 Bytes=119)
47 46 NESTED LOOPS (Cost=747 Card=1 Bytes=98)
48 47 NESTED LOOPS (Cost=744 Card=1 Bytes=62)
49 48 NESTED LOOPS (Cost=744 Card=1Bytes=54)
50 49 VIEW OF 'PS_LNTPRJOBSYSJRVW'(Cost=741 Card=1 Bytes=9)
51 50 FILTER
52 51 NESTED LOOPS (OUTER) (Cost=735 Card=1 Bytes=68)
53 52 NESTED LOOPS (Cost=734Card=1 Bytes=51)
54 53 NESTED LOOPS (Cost=734 Card=1 Bytes=43)
55 54 TABLE ACCESS (BY INDEX ROWID) OF 'PS_JOB' (Cost=734 Card=1 Bytes=32)
56 55 INDEX (RANGE SCAN) OF 'PSCJOB' (NON-UNIQUE) (Cost=206 Card=1013)
57 54 INDEX (UNIQUE SCAN) OF 'PS_EMPLOYMENT' (UNIQUE)
58 53 INDEX (UNIQUE SCAN) OF 'PS_PERSONAL_DATA' (UNIQUE)
59 52 INDEX (RANGE SCAN) OF'PS_POSITION_DATA' (UNIQUE) (Cost=1 Card=1 Bytes=17)
60 51 SORT (AGGREGATE)
61 60 FIRST ROW (Cost=3 Card=1 Bytes=19)
62 61 INDEX (RANGE SCAN (MIN/MAX)) OF 'PSAJOB' (NON-UNIQUE) (Cost=3 Card=207700)
63 51 SORT (AGGREGATE)
64 63 FIRST ROW (Cost=3 Card=1 Bytes=22)
65 64 INDEX (RANGE SCAN (MIN/MAX)) OF 'PSAJOB' (NON-UNIQUE) (Cost=3 Card=207700)
66 51 SORT (AGGREGATE)
67 66 FIRST ROW (Cost=2 Card=1 Bytes=17)
68 67 INDEX (RANGE SCAN (MIN/MAX)) OF 'PS_POSITION_DATA' (UNIQUE) (Cost=2 Card=9000)
69 49 TABLE ACCESS (BY INDEX ROWID) OF 'PS_JOB' (Cost=3 Card=1 Bytes=45)
70 69 INDEX (RANGE SCAN) OF 'PSAJOB' (NON-UNIQUE) (Cost=2 Card=1)
71 70 SORT (AGGREGATE)
72 71 INDEX (RANGE SCAN) OF'PSAJOB' (NON-UNIQUE) (Cost=3 Card=1 Bytes=19)
73 72 SORT (AGGREGATE)
74 73 FIRST ROW (Cost=3Card=8 Bytes=88)
75 74 INDEX (RANGE SCAN (MIN/MAX)) OF 'PSAJOB' (NON-UNIQUE) (Cost=3 Card=25963)
76 70 SORT (AGGREGATE)
77 76 FIRST ROW (Cost=3 Card=8 Bytes=88)
78 77 INDEX (RANGE SCAN (MIN/MAX)) OF 'PSAJOB' (NON-UNIQUE) (Cost=3 Card=25963)
79 48 INDEX (UNIQUE SCAN) OF 'PS_PERSONAL_DATA' (UNIQUE)
80 47 TABLE ACCESS (BY INDEX ROWID) OF'PS_JOB' (Cost=3 Card=1 Bytes=36)
81 80 INDEX (RANGE SCAN) OF 'PSAJOB'(NON-UNIQUE) (Cost=2 Card=1)
82 81 SORT (AGGREGATE)
83 82 FIRST ROW (Cost=3 Card=1 Bytes=19)
84 83 INDEX (RANGE SCAN (MIN/MAX)) OF 'PSAJOB' (NON-UNIQUE) (Cost=3 Card=207700)
85 81 SORT (AGGREGATE)
86 85 FIRST ROW (Cost=3 Card=1 Bytes=22)
87 86 INDEX (RANGE SCAN (MIN/MAX)) OF 'PSAJOB' (NON-UNIQUE) (Cost=3 Card=207700)
88 46 INDEX (RANGE SCAN) OF 'PS8POSITION_DATA' (NON-UNIQUE) (Cost=1 Card=1 Bytes=21)
89 45 INDEX (UNIQUE SCAN) OF 'PS_BUS_UNIT_TBL_HR' (UNIQUE)
90 44 INDEX (UNIQUE SCAN) OF 'PS_EMPLOYMENT'(UNIQUE)
91 43 INDEX (RANGE SCAN) OF 'PS_POSITION_DATA'(UNIQUE) (Cost=1 Card=1 Bytes=9)
92 42 INDEX (FULL SCAN) OF 'PS0LOCATION_TBL' (NON-UNIQUE) (Cost=1 Card=1 Bytes=24)
93 41 INDEX (RANGE SCAN) OF 'PS0LOCATION_TBL' (NON-UNIQUE) (Cost=1 Card=1 Bytes=24)
94 40 SORT (AGGREGATE)
95 94 FIRST ROW (Cost=2 Card=1 Bytes=17)
96 95 INDEX (RANGE SCAN (MIN/MAX)) OF 'PS_POSITION_DATA' (UNIQUE) (Cost=2 Card=9000)
97 4 TABLE ACCESS (BY INDEX ROWID) OF 'PS_POSITION_DATA' (Cost=2 Card=1 Bytes=13)
98 97 NESTED LOOPS (Cost=9 Card=1 Bytes=19)
99 98 VIEW OF 'VW_NSO_1' (Cost=5 Card=1 Bytes=6)
100 99 SORT (UNIQUE)
101 100 NESTED LOOPS (Cost=5 Card=1 Bytes=44)
102 101 TABLE ACCESS (BY INDEX ROWID) OF 'PSOPRDEFN' (Cost=2 Card=1 Bytes=14)
103 102 INDEX (UNIQUE SCAN) OF 'PS_PSOPRDEFN'(UNIQUE) (Cost=1 Card=1)
104 101 TABLE ACCESS (BY INDEX ROWID) OF 'PS_JOB' (Cost=3 Card=1 Bytes=30)
105 104 INDEX (RANGE SCAN) OF 'PSAJOB' (NON-UNIQUE) (Cost=2 Card=1)
106 105 SORT (AGGREGATE)
107 106 INDEX (RANGE SCAN) OF 'PSAJOB' (NON-UNIQUE) (Cost=3 Card=8 Bytes=128)
108 105 SORT (AGGREGATE)
109 108 INDEX (RANGE SCAN) OF 'PSAJOB' (NON-UNIQUE) (Cost=3 Card=1 Bytes=19)
110 98 INDEX (RANGE SCAN) OF 'PS_POSITION_DATA' (UNIQUE) (Cost=1 Card=1)
111 3 TABLE ACCESS (BY INDEX ROWID) OF 'PS_PERSONAL_DATA'(Cost=1 Card=1 Bytes=25)
112 111 INDEX (UNIQUE SCAN) OF 'PS_PERSONAL_DATA' (UNIQUE)
113 2 INDEX (RANGE SCAN) OF 'PS_LNT_ASN_SKL_TBL' (UNIQUE) (Cost=1 Card=10076 Bytes=80608)
Statistics
70 recursive calls
0 db block gets
1186931 consistent gets
5660 physical reads
60 redo size
462 bytes sent via SQL*Net to client
373 bytes received via SQL*Net from client
2 SQL*Net roundtrips to/from client
2 sorts (memory)
0 sorts (disk)
0 rows processedMy thoughts for this is:
1. NLJ high cost -- rewrite inner sub-query
2. sort is done for each join for max function every time so, therefore try use use sort merge hint
3. h alias has been referenced twice for table name.
PLEASE TELL ME WHAT TO DO IF I AM ORACLE DBA.
Thanks in advance.
Edited by: user2060331 on Mar 25, 2010 9:17 AM
Edited by: user2060331 on Mar 25, 2010 9:21 AM
Edited by: user2060331 on Mar 25, 2010 9:32 AM
Edited by: user2060331 on Mar 25, 2010 9:47 AMNo it's not. You should see indentations for each level of the explain plan. You've lost all of it. It should look like this (not your query):
PLAN_TABLE_OUTPUT
| Id | Operation | Name | Rows | Bytes | Cost | Inst |IN-OUT|
| 0 | SELECT STATEMENT | | 16116 | 2911K| 712 | | |
| 1 | FILTER | | | | | | |
| 2 | CONNECT BY WITH FILTERING | | | | | | |
| 3 | FILTER | | | | | | |
| 4 | COUNT | | | | | | |
| 5 | HASH JOIN RIGHT OUTER | | 16116 | 2911K| 712 | | |
| 6 | REMOTE | LSW_USR_GRP_XREF | 518 | 13986 | 4 | MYPROJ~ | R->S |
| 7 | HASH JOIN RIGHT OUTER | | 16116 | 2486K| 707 | | |
| 8 | REMOTE | LSW_USR_XREF | 222 | 2886 | 4 | MYPROJ~ | R->S |
| 9 | HASH JOIN RIGHT OUTER| | 16116 | 2282K| 702 | | |
| 10 | TABLE ACCESS FULL | MYPROJ_PROCESS_MAP | 176 | 4752 | 4 | | |
| 11 | HASH JOIN OUTER | | 16116 | 1857K| 698 | | |
| 12 | TABLE ACCESS FULL | MYPROJ_MPPA | 16116 | 1243K| 71 | | |
| 13 | REMOTE | LSW_TASK | 80730 | 3074K| 625 | MYPROJ~ | R->S |
| 14 | HASH JOIN | | | | | | |
| 15 | CONNECT BY PUMP | | | | | | |
| 16 | COUNT | | | | | | |
| 17 | HASH JOIN RIGHT OUTER | | 16116 | 2911K| 712 | | |
| 18 | REMOTE | LSW_USR_GRP_XREF | 518 | 13986 | 4 | MYPROJ~ | R->S |
| 19 | HASH JOIN RIGHT OUTER | | 16116 | 2486K| 707 | | |
| 20 | REMOTE | LSW_USR_XREF | 222 | 2886 | 4 | MYPROJ~ | R->S |
| 21 | HASH JOIN RIGHT OUTER| | 16116 | 2282K| 702 | | |
| 22 | TABLE ACCESS FULL | MYPROJ_PROCESS_MAP | 176 | 4752 | 4 | | |
| 23 | HASH JOIN OUTER | | 16116 | 1857K| 698 | | |
| 24 | TABLE ACCESS FULL | MYPROJ_MPPA | 16116 | 1243K| 71 | | |
| 25 | REMOTE | LSW_TASK | 80730 | 3074K| 625 | MYPROJ~ | R->S |
--------------------------------------------------------------------------------------------------- -
Please help with this query!
Hi All,
I have this this table:
Term Grade
term_A A
term_A A
term_A B
term_A B
term_B D
term_B F
term_B F
term_C C
How do I display so that it appears this way?
term_A A 2
term_A B 2
term_B D 1
term_B F 2
term_C C 1
Thank you. Appreciate all the help!Please read about [url http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14200/functions001.htm#sthref962]aggregate functions in the manual.
Regards,
Rob. -
Hello everyone,
i am pretty new and still learning SQL for my work.
i have a query to pull all the data greater than 5,000,000 as below which worked sucessfully
select a.bf_fund_cd fund, a.bf_bdob_cd object, b.lev5, b.bf_orgn_cd,sum(a.data) data
from cp_o_pbuser.bf_data a
inner join cp_o_pbuser.bf_orgn_cnsl_tbl b
on a.bf_orgn_cd = b.bf_orgn_cd
WHERE a.bf_tm_perd_cd in (select bf_tm_perd_chld_cd from cp_o_pbuser.bf_tm_perd_cnsl_tbl where bf_tm_perd_select_cd='FINALTOT')
and a.bf_bdob_cd in ('R_9001')
having sum(a.data)>5000000
group by a.bf_fund_cd, a.bf_bdob_cd, b.lev5,b.bf_orgn_cd
order by a.bf_bdob_cd, b.lev5
here is the result
SS_26300_1 - Lev5 (everything rollup to this one)
SS_26460_2 - $ 5,000,000 -->bf_orgn_cd (showed)
SS_26461_2 - $6,000,000 -->bf_orgn_cd (showed)
SS_26473_2 - $5,500,000 -->bf_orgn_cd (showed)
SS_26475_2 -$4,000,000 -->bf_orgn_cd (not showed, i want to this record to appear too)
However, according to the new change, i will need to pull out all the data even though they are smaller than 5,000,000 in the
lev5 colunm. ex: there is one record missing in SS_26300_1 with SS_26475_2 in BF_ORGN_CD and the data is 4,000,000 which i need to include in my query.
i really appreciate of your time and help.
Sincerely,clear example: thank you
SS_21111_1 -Lev5 (dont need to show) ---> less than 5,000000
SS_21112_2 -$1,500,000(dont need to show)
SS_21113_2 -$1,750,000(dont need to show)
SS_26300_1 - Lev5 (everything rollup to this one) greater than 5,000,000 (everything needs to show)
SS_26460_2 - $ 5,000,000 -->bf_orgn_cd (showed)
SS_26461_2 - $6,000,000 -->bf_orgn_cd (showed)
SS_26473_2 - $5,500,000 -->bf_orgn_cd (showed)
SS_26475_2 -$4,000,000(i want to this one to show) -
Tons of Questions: PLEASE REPLY TO THIS THREAD
Hi, I am a 16 year old teen that is about to wait for the right moment to have my dream of starting a youtube channel. Ive done a lot of research comparing how any type of laptop will compare when I record and play my games, because i mostly want to get into gaming youtube channel. Although i might want to do just gaming ive also wanted to do videos of unboxing and music covers. My friend that knows a lot about computers told me that i should get a mac if i want to do mainly editing, or if i want to just game and record i should buy a pc laptop. He recommended that i should buy a laptop from IBUYPOWER that has better specs than that of the mac book pro retina 15" and is cheaper. That moves onto my next question asking why are macs so overpriced? I did all my research on that too, and it most likely seems it is almost a brand name expense like louis vuotton. Next question is, how is the cheapest way I can get the 15" retina mac book pro for the cheapest price possible, should i wait until black friday for sales to lower, or should i wait until the next year to get the next 2015 model. Is the newer progressing years of MacBook pros that much better that i should wait until the next year to get it. Next question, say i wanted to play a game that is only on windows platform, ex. Skyrim. Should i play a cracked version that has been reformatted to the mac, or should i just download windows on my mac so that i can play it with more ease of use that way, instead of having to use everything in the mac side when it was originally formatted for Windows. Anyway thank you for your time, and even if you dont know the answer to these questions, PLEASE ANSWER ANYWAY, THANK YOU!
Mac is not overpriced...
You pay for seamless Software/Hardware integration. Superior build and workmanship. And of course the OS X experience.
As far as laptops go I believe apple has the best offerings on the market by a longshot.
I am however not a big fan of buying a Mac and using it with windows... It kind of defeats the point, unless you are a developer, or need it occasionally for certain activities only Windows can perfrom.
You stated you want to however start a youtube gaming channel, I think its better to buy a desktop for this type of activity. Obviously you will game for hours on end if you want to create some sort of feedback/opinion or reviews for different games.
Also you will have to run windows to review the latest and best platforms/games. Many current games are not available on OSX platform. So your review channel would not be very good if you can only review OSX selected games.
That said there could also be a niche on youtube for reviewing exclusively OSX games. I mean you could review different games from the apple app store etc.
It really depends on what you want to do...
There are many good windows based machines too to do this sort of thing... In your case it may be the better option.
There are certainly Windows based laptops that do a much better job in the gaming compartment than a Macbook pro. In fact to play top end games you will need a top of the line 15 inch MBP with Discreet Graphics (Anything else only has Integrated graphics, games still playable, but there are limitations). You can get a much more affordable/powerfull laptop that is Windows based... Or more practically a more affordable and powerful Desktop...
I must however add.
Coming from Windows environment... My first Macbook Pro and OSX experience put all previous windows machines to shame...
I am a very pleased consumer, and personally I am sticking with my macbook pro
Also if a game is not available for MAC. You can't get a "cracked reformated version".... It does not work that way.... It involves serious programming.
You would need to install windows on the MAC
Answered some of the questions. Your mutiple questions, lack of punctuation, and paragraphs was a nightmare to read.
If you expect help please make your questions easier to read. Maybe even number your multiple questions. -
ITUNES -- APPLE Please reply to this question
My computer power supply shorted and wiped out my harddrive in which I could not get any information out of it to save it. I have had problems with itunes in which I was unable to copy those items to dvd. I spend a lot of money on itunes and was wondering if support can help me retrieve my music videos, music and movies I had purchased. Please give me an email address I can contact someone personally or a telephone number. I purchased these items and since i spend a lot of money on Itunes I feel that as a regular customer I should at least be able to redownload these music videos, music, and movies if my hard drive ever failed.
You are NOT addressing Apple here. This is a user forum.
It is your responsibility to backup your music/videos,etc.
You can click "Support" at the top of this page and follow the link to itunes store support, if you would like to e-mail them, but failing to backup your purchases is not a great excuse. -
Please reply to this: non-consecutive element
Hello Every one,
How can i process non-consecutive element in the forall loop to update the table . i can not use .exists method as if in not allowed in forall syntax.
So please can anyone give me example how to process in forall loop.
in 10g we can use indices of or value of clause. what is the alternative in 9i r2.
Thank you in advance.
[Please don't create duplicate threads. It's a sure way to be ignored.
non-consecutive element in collection
Maybe you are looking for
-
Front end application error after import script run successfully in R12
Hi , i got an exception in R12 environment. i developed one simple OAF page and deployed in apps import script run successfully. but when i am opening that page in Front end it will give an exception. That is Exception Details. oracle.apps.fnd.framew
-
Link creation in Acrobat - viewing on ipad
Hi All As posted above im having problems with a pdf and links on an ipad. I have a 10 page pdf that I have created in indesign ( this doesnt have any interactivity set, just standard pdf output) I then set links using the link tool native in Acrobat
-
How to delete report node name ?
Hi All, We migrated our peopleSoft development database to production , now I want to delete all report node name which were configured for development , is it possible ??, if yes please help. Thanks.
-
I just combined two identical 2TB drives for a striped RAID 0. I'll definitely be capturing my footage onto it and editing from this RAID, but just wondering....should I output my files to a different drive? Before the RAID, I would edit on one drive
-
Search a paragraph style next to other paragraph style...
I need search a paragraph style ("AAA") next to other paragraph style ("BBB"), and modifiy in this case ("BBB" to "BBB+") with a "spaceBefore" of 3 mm... My code don't work... Please, help me...!!!