Querying Hierarchy - Above + Below
Hi,
I have the following situation:
I have a table HIERARCHY with the following fields:
<PRE>
CHILD PARENT
===================
100
101 100
102 101
103 102
104
105 100
106 105
This is what I need :
CHILD PARENT PATH LEVEL
=============================
100 100 1
101 100 100/101 2
102 101 100/101/102 3
103 102 100/101/102/103 4
104 104 1
105 100 100/105 2
106 105 105/106 2
Now, the important part is when I query on the above result for example "WHERE CHILD = 102", I should get the whole hierarchy (above + below).
So the result would look like ...
CHILD PARENT PATH LEVEL
=============================
100 100 1
101 100 100/101 2
102 101 100/101/102 3
103 102 100/101/102/103 4
</PRE>
Any idea how this can be achieved via SQL query....
Thanks in Advance.
Regards
Pat
Hi, Pat,
It sounds like you want a to do a CONNECT BY query on the resuot set of a UNION of 2 CONNECT BY queries
(1) a bottom-up query, of the ancestors of the target row
(2) a top-down query, of the descendants of the target row
WITH universe AS
SELECT child, parent
FROM hierarchy
START WITH child = :target_child
CONNECT BY child = PRIOR parent
-- Bottom-up part (for target and its ancestors) is above
UNION
-- Top-down part (for descendants) is below
SELECT child, parent
FROM hierarchy
START WITH parent = :target_child
CONNECT BY parent = PRIOR child
SELECT child
, parent
, LTRIM (SYS_CONNECT_BY_PATH (child, '/'), '/') AS path
, LEVEL
FROM universe
START WITH parent IS NULL
CONNECT BY parent = PRIOR child
;I hope this answers your question.
If not, post a little sample data (CREATE TABLE and INSERT statements) and the results you want from that data (if they are not the results you already posted).
Always mention your version of Oracle.
Similar Messages
-
In the query designer I have built a query that contains on the rows Cost Centre, Employees and GL Codes. I have activated a Presenation Hierarchy e.g. on the rows section clicked on display as hierarchy. However when I run the query the totals are above rather than below the nodes. I have set the hierarchy on the infobject to below. I've set it on the query to display below but still it dispalys above. Any ideas?
Hi Joel,
There is no way to display the total at the bottom for a hierarchy which is having "Position of Lower-Level nodes" = Below in the Query Designer. If you want the total at bottom reverse the hierarchy select "Position of Lower-Level nodes" = above and it will show the results at bottom but your hierarchy will be displayed bottom to top direction.
If you will select the Query to show resout below, it is only applicable for Non Hierarchy data.
Regards,
Kams -
Multi-query group above report creates more pages
Hi,
I have a multi-query group above report (paper only), the parent group creates 5 rows(subframes) all onto the same page, but then creates 4 more IDENTICAL pages!!?
at the end I have 5 repating frames and 5 pages.
If I set Maximum Records per Page to 1, I have 5 pages (IDENTICAL) with the first frame only...
any idea?
cheers
Matteohello,
you will have to create a counter, that tells you the numbers of students (summary-column, function : count, reset on : course) and create a format-trigger on the heading that hides it when the number of students is 0.
regards,
the oracle reports team --pw -
Items above/below region content
Hello ApEx development team,
What happened with this enhancement:
Items above/below region content
I think, this limitation is annoying and needs to be removed. It takes to much unnecessary
workaround to overcome such a trivial problem.
Best regards,
Denes Kubicek
http://deneskubicek.blogspot.com/
http://www.opal-consulting.de/training
http://htmldb.oracle.com/pls/otn/f?p=31517:1
-------------------------------------------------------------------Hi,
Yes, that would be an excellent enhancement!
I was just struggling with getting a "Display as" item (showing the total of the report) under a report. There was no way, it always displayed above the report, even with "Horizontal / Vertical Alignment: right bottom".
This post made me try to move the region from "Display Point: Page Template Body (3)" to "Display Point: Page Template Body (2)". Now it works fine...
Vikas' proposal:
Yes, I had brought this up more than a year ago. This would allow us to use a WYSIWYG HTML editor to design a region template with #ITEM_NAME# substitutions in it and items with those names would be plopped into those positions.
...would be great indeed!
Regards,
Roger -
Cell shading and adding a graphic above/below a paragraph
Hi all--
I'm creating a two-column, one-row table for examples. For the left column, I set up shading for 30% light gray. For the paragraph tag in that same column, I'm importing a frame, which contains the word "Example," from the Reference page. To do this, I selected the Advanced tab in the Paragraph Designer, and selected the frame I created on the Reference page from the Frame Below Pgf. drop-down list.
The frame appears in the table column, but it appears that the background of the word "Example" isn't transparent. So, the shading of the cell is blocked out by the frame from the Reference page. See the attached .gif file.
Can anyone provide ideas for either making the frame transparent, or adding shading to the frame? Thanks!Lance,
Going back to your original question, I did some testing. On the reference page, select the frame containing the word Example. Then from the drawing tools, set its fill pattern to None; this makes the frame transparent.
In my testing, I created a graphic frame with fill of None and inserted a text line inside it. This works.
You can also create a text frame inside the graphic frame and also set the fill pattern of the text frame to None. This also works.
Apparently, although you can create a text frame on the reference page, FrameMaker does not allow you to name it; hence, you cannot use it in the paragraph designer as a frame above/below. But creating a graphic frame with fill of None DOES work.
Good luck,
Van -
HI. I would like to arrange over 30 pictures into one grid-like ARRANGEMENT. (meaning above, below, left, right, of each other and so forth to form a rectangle)
Please help...thxYou messaged me that the contact sheet look is what want but w/o spaces.
One method is to actually start with the PSE contact sheet tool. I assume your version has it (mine is PSE 2). Maybe your version has an option to remove spaces; mine doesn't. In this example I created a sheet of 4 rows and 3 columns, with the option to not flatten the layers. Each picture appears on a separate layer.
On each row I moved the left and right pics inward to remove the spaces between the pics:
Activate the Move tool. Click on the left pic and use the arrow keys to move it inward. Same with the right pic.
Now to remove the spaces between the rows. To make this easier. lock together the pics on each row. Here I locked the pics on the top row, then used the arrow keys to move the row as a unit downward. An alternative method would be to merge the 3 pics on each row and move that merged layer. Do the same for the remaining rows.
This method works of course if the pictures are all the same size and all aligned vertical or horizontal.
If you don't want to use the contact sheet tool (e.g., if the pics are different sizes or alignment) you can do this:
Create a blank canvas.
Open a picture, select it (Select > All) and copy to the clipboard (Edit > Copy).
Activate the blank canvas and Edit > Paste. The picture will be placed on its own layer.
Do the same with the remaining pics and use the Move tool with mouse and/or arrow keys to position them where you want.
The advantage of the first method is that the rows and columns are precisely aligned. Using the mouse to align the pictures could be a little tricky. -
Querying database for the row above & below
Assuming I am extracting a database info with the ID = 2345.
How do I query the database for the ID number before and after this
current ID number? This is assuming that the ID number is not
sequential.
I'm trying to do a back and next button for an article
feature for my website.
Thanks.quote:
I'm trying to do a back and next button for an article
feature for my website.
Then you don't need to do this the way you have
asked.
<!--- Create some parameters --->
<cfparam name="startRow" default="1">
<cfparam name="maxRows" default="1">
<cfparam name="next" default="0">
<cfparam name="previous" default="0">
<!--- output the query --->
<cfoutput query="qry_result" startrow="#statRow#"
maxrows="#maxRows#">
</cfoutput>
<cfset next = startRow + 1>
<cfset previous = startRow - 1>
<cfif previous GT 0>
<a href="myPage.cfm?startRow=#previous#">Previous
Record</a>
</cfif>
<cfif next LTE qry_result.recordcount>
<a href="myPage.cfm?startRow=#next#">Next
Record</a>
</cfif>
This will then navigate through the recordset.
Ken -
How do I avoid ORA-01473 when querying hierarchial on tables with VPD predicates
My question is how to circumvent what seems to be a limitation i ORACLE, if at all possible. Please read on.
When using VPD (Virtual Private Database) predictaes on a table and performing a hierarchial query on that table I get the following error message:
ORA-01473: cannot have subqueries in CONNECT BY CLAUSE
My query may look like the folwing:
SELECT FIELD
FROM TABLE
START WITH ID = 1
CONNECT BY PRIOR ID = PARENT
As my predicate contains a query in it self, I suspect that the implicit augmentation of the predicate results in a query that looks like:
SELECT FIELD
FROM TABLE
START WITH ID = 1
CONNECT BY PRIOR ID = PARENT
AND OWNER IN (SELECT OWNER FROM TABLE2 WHERE ...)
at least, when executing a query like the one above (with the explicit predicate) I get the identical error message.
So my question is:
Do you know of any way to force the predicate to augment itslef onto the WHERE-clause? I would be perfectly happy with a query that looks like:
SELECT FIELD
FROM TABLE
START WITH ID = 1
CONNECT BY PRIOR ID = PARENT
WHERE OWNER IN (SELECT OWNER FROM TABLE2 WHERE ...)
or do you know of any fix/patch/release to ORACLE that allows you to include subqueries in the CONNECT BY-clause and eliminates the error message?The WHERE clause or AND clause applies to the line directly above it. Please see the examples of valid and invalid queries below, which differ only in the placement of the WHERE or AND clause. If this is not sufficient, please provide some sample data and desired output to clarify what you need.
-- valid:
SQL> SELECT empno,
2 mgr,
3 deptno
4 FROM emp
5 WHERE deptno IN
6 (SELECT deptno
7 FROM dept
8 WHERE dname = 'RESEARCH')
9 START WITH mgr = 7566
10 CONNECT BY PRIOR empno = mgr
11 /
EMPNO MGR DEPTNO
7788 7566 20
7876 7788 20
7902 7566 20
800 7902 20
-- invalid:
SQL>
SQL> SELECT empno,
2 mgr,
3 deptno
4 FROM emp
5 START WITH mgr = 7566
6 CONNECT BY PRIOR empno = mgr
7 WHERE deptno IN
8 (SELECT deptno
9 FROM dept
10 WHERE dname = 'RESEARCH')
11 /
WHERE deptno IN
ERROR at line 7:
ORA-00933: SQL command not properly ended
-- valid:
SQL>
SQL> SELECT empno,
2 mgr,
3 deptno
4 FROM emp
5 START WITH mgr = 7566
6 AND deptno IN
7 (SELECT deptno
8 FROM dept
9 WHERE dname = 'RESEARCH')
10 CONNECT BY PRIOR empno = mgr
11 /
EMPNO MGR DEPTNO
7788 7566 20
7876 7788 20
7902 7566 20
800 7902 20
-- invalid:
SQL>
SQL> SELECT empno,
2 mgr,
3 deptno
4 FROM emp
5 START WITH mgr = 7566
6 CONNECT BY PRIOR empno = mgr
7 AND deptno IN
8 (SELECT deptno
9 FROM dept
10 WHERE dname = 'RESEARCH')
11 /
FROM emp
ERROR at line 4:
ORA-01473: cannot have subqueries in CONNECT BY clause -
Looking for a proper analytical query/solution for below data
I have data as shown below:
mob_id status_code status_text media_date
39585 600 Online 04-Aug-09
54988 600 Online 05-Aug-09
39585 600 Online 05-Aug-09
39585 600 Online 06-Aug-09
39585 600 Online 07-Aug-09
39585 600 Online 08-Aug-09
39585 600 Online 09-Aug-09
39585 600 Online 10-Aug-09
39585 600 Online 11-Aug-09
39585 600 Online 12-Aug-09
39585 600 Online 13-Aug-09
39585 600 Online 14-Aug-09
39585 600 Online 15-Aug-09
39585 600 Online 16-Aug-09
39585 700 Deinstall 17-Aug-09
54988 600 Online 06-Aug-09
54988 600 Online 07-Aug-09
54988 600 Online 08-Aug-09
54988 600 Online 09-Aug-09
54988 600 Online 10-Aug-09
54988 600 Online 11-Aug-09
54988 600 Online 12-Aug-09
54988 600 Online 13-Aug-09
54988 600 Online 14-Aug-09
54988 600 Online 15-Aug-09
54988 600 Online 16-Aug-09
39585 600 Online 20-Aug-09
39585 600 Online 21-Aug-09
39585 600 Online 22-Aug-09
39585 600 Online 23-Aug-09
39585 600 Online 24-Aug-09
39585 600 Online 25-Aug-09
39585 700 Deinstall 26-Aug-09
39585 600 Online 27-Aug-09
39585 600 Online 28-Aug-09
39585 600 Online 29-Aug-09
39585 600 Online 30-Aug-09
39585 600 Online 31-Aug-09
39585 600 Online 01-Sep-09
39585 700 Deinstall 02-Sep-09
54988 600 Online 17-Aug-09
54988 600 Online 18-Aug-09
54988 600 Online 19-Aug-09
54988 600 Online 20-Aug-09
54988 600 Online 21-Aug-09
54988 600 Online 22-Aug-09
54988 600 Online 23-Aug-09
54988 600 Online 24-Aug-09
54988 600 Online 25-Aug-09
54988 700 Deinstall 26-Aug-09
69875 600 Online 20-Aug-09
69875 600 Online 21-Aug-09
69875 600 Online 22-Aug-09
69875 600 Online 23-Aug-09
69875 600 Online 24-Aug-09
69875 600 Online 25-Aug-09
69875 600 Online 26-Aug-09
Using the above data I need to find out the below result set. Can any one help in this?
occurrnace_seq mob_id start_media_date end_media_date no_of_days
1 39585 04-Aug-09 17-Aug-09 13
2 39585 20-Aug-09 26-Aug-09 6
3 39585 27-Aug-09 02-Sep-09 6
1 54988 05-Aug-09 26-Aug-09 21
1 69875 20-Aug-09 null null
Here start_media_date can be found with status_code=600 & end_media_date can be found with status_code=700.
Please look that the mobility_id is starting multiple times.
Any one can help me in producing this result using SQL or PL/SQL.
Many thanks in advance.
Thanks
Guttiwasguttis wrote:
Can I run this query on a 70 million records? Does it raise any performance problems. If you have any idea, just thorough some possible suggestions to protect such isses.Well, you can certailny run it on 70 million records. How long it will run depends on your hardware, Oracle and OS settings. Said that, there is a simpler solution:
select occurrenace_seq,
mob_id,
min(case grp when 'start-of-group' then media_date end) start_media_date,
max(case grp when 'end-of-group' then media_date end) end_media_date,
max(case grp when 'end-of-group' then media_date end) - min(case grp when 'start-of-group' then media_date end) no_of_days
from (
select t.*,
case
when status_text = 'Deinstall' then 'end-of-group'
when lag(status_text,1,'Deinstall') over(partition by mob_id order by media_date) = 'Deinstall' then 'start-of-group'
end grp,
sum(case status_text when 'Deinstall' then 1 else 0 end) over(partition by mob_id order by media_date) +
case lag(status_text,1,'Deinstall') over(partition by mob_id order by media_date) when 'Deinstall' then 1 else 0 end occurrenace_seq
from your_table t
where grp in ('start-of-group','end-of-group')
group by mob_id,
occurrenace_seq
order by mob_id,
occurrenace_seq
/With your sample:
with t as (
select 39585 mob_id,600 status_code,'Online' status_text, to_date('04-Aug-09','dd-mon-yy') media_date from dual union all
select 54988,600,'Online',to_date('05-Aug-09','dd-mon-yy') from dual union all
select 39585,600,'Online',to_date('05-Aug-09','dd-mon-yy') from dual union all
select 39585,600,'Online',to_date('06-Aug-09','dd-mon-yy') from dual union all
select 39585,600,'Online',to_date('07-Aug-09','dd-mon-yy') from dual union all
select 39585,600,'Online',to_date('08-Aug-09','dd-mon-yy') from dual union all
select 39585,600,'Online',to_date('09-Aug-09','dd-mon-yy') from dual union all
select 39585,600,'Online',to_date('10-Aug-09','dd-mon-yy') from dual union all
select 39585,600,'Online',to_date('11-Aug-09','dd-mon-yy') from dual union all
select 39585,600,'Online',to_date('12-Aug-09','dd-mon-yy') from dual union all
select 39585,600,'Online',to_date('13-Aug-09','dd-mon-yy') from dual union all
select 39585,600,'Online',to_date('14-Aug-09','dd-mon-yy') from dual union all
select 39585,600,'Online',to_date('15-Aug-09','dd-mon-yy') from dual union all
select 39585,600,'Online',to_date('16-Aug-09','dd-mon-yy') from dual union all
select 39585,700,'Deinstall', to_date('17-Aug-09','dd-mon-yy') from dual union all
select 54988,600,'Online',to_date('06-Aug-09','dd-mon-yy') from dual union all
select 54988,600,'Online',to_date('07-Aug-09','dd-mon-yy') from dual union all
select 54988,600,'Online',to_date('08-Aug-09','dd-mon-yy') from dual union all
select 54988,600,'Online',to_date('09-Aug-09','dd-mon-yy') from dual union all
select 54988,600,'Online',to_date('10-Aug-09','dd-mon-yy') from dual union all
select 54988,600,'Online',to_date('11-Aug-09','dd-mon-yy') from dual union all
select 54988,600,'Online',to_date('12-Aug-09','dd-mon-yy') from dual union all
select 54988,600,'Online',to_date('13-Aug-09','dd-mon-yy') from dual union all
select 54988,600,'Online',to_date('14-Aug-09','dd-mon-yy') from dual union all
select 54988,600,'Online',to_date('15-Aug-09','dd-mon-yy') from dual union all
select 54988,600,'Online',to_date('16-Aug-09','dd-mon-yy') from dual union all
select 39585,600,'Online',to_date('20-Aug-09','dd-mon-yy') from dual union all
select 39585,600,'Online',to_date('21-Aug-09','dd-mon-yy') from dual union all
select 39585,600,'Online',to_date('22-Aug-09','dd-mon-yy') from dual union all
select 39585,600,'Online',to_date('23-Aug-09','dd-mon-yy') from dual union all
select 39585,600,'Online',to_date('24-Aug-09','dd-mon-yy') from dual union all
select 39585,600,'Online',to_date('25-Aug-09','dd-mon-yy') from dual union all
select 39585,700,'Deinstall', to_date('26-Aug-09','dd-mon-yy') from dual union all
select 39585,600,'Online',to_date('27-Aug-09','dd-mon-yy') from dual union all
select 39585,600,'Online',to_date('28-Aug-09','dd-mon-yy') from dual union all
select 39585,600,'Online',to_date('29-Aug-09','dd-mon-yy') from dual union all
select 39585,600,'Online',to_date('30-Aug-09','dd-mon-yy') from dual union all
select 39585,600,'Online',to_date('31-Aug-09','dd-mon-yy') from dual union all
select 39585,600,'Online',to_date('01-Sep-09','dd-mon-yy') from dual union all
select 39585,700,'Deinstall', to_date('02-Sep-09','dd-mon-yy') from dual union all
select 54988,600,'Online',to_date('17-Aug-09','dd-mon-yy') from dual union all
select 54988,600,'Online',to_date('18-Aug-09','dd-mon-yy') from dual union all
select 54988,600,'Online',to_date('19-Aug-09','dd-mon-yy') from dual union all
select 54988,600,'Online',to_date('20-Aug-09','dd-mon-yy') from dual union all
select 54988,600,'Online',to_date('21-Aug-09','dd-mon-yy') from dual union all
select 54988,600,'Online',to_date('22-Aug-09','dd-mon-yy') from dual union all
select 54988,600,'Online',to_date('23-Aug-09','dd-mon-yy') from dual union all
select 54988,600,'Online',to_date('24-Aug-09','dd-mon-yy') from dual union all
select 54988,600,'Online',to_date('25-Aug-09','dd-mon-yy') from dual union all
select 54988,700,'Deinstall', to_date('26-Aug-09','dd-mon-yy') from dual union all
select 69875,600,'Online',to_date('20-Aug-09','dd-mon-yy') from dual union all
select 69875,600,'Online',to_date('21-Aug-09','dd-mon-yy') from dual union all
select 69875,600,'Online',to_date('22-Aug-09','dd-mon-yy') from dual union all
select 69875,600,'Online',to_date('23-Aug-09','dd-mon-yy') from dual union all
select 69875,600,'Online',to_date('24-Aug-09','dd-mon-yy') from dual union all
select 69875,600,'Online',to_date('25-Aug-09','dd-mon-yy') from dual union all
select 69875,600,'Online',to_date('26-Aug-09','dd-mon-yy') from dual
select occurrenace_seq,
mob_id,
min(case grp when 'start-of-group' then media_date end) start_media_date,
max(case grp when 'end-of-group' then media_date end) end_media_date,
max(case grp when 'end-of-group' then media_date end) - min(case grp when 'start-of-group' then media_date end) no_of_days
from (
select t.*,
case
when status_text = 'Deinstall' then 'end-of-group'
when lag(status_text,1,'Deinstall') over(partition by mob_id order by media_date) = 'Deinstall' then 'start-of-group'
end grp,
sum(case status_text when 'Deinstall' then 1 else 0 end) over(partition by mob_id order by media_date) +
case lag(status_text,1,'Deinstall') over(partition by mob_id order by media_date) when 'Deinstall' then 1 else 0 end occurrenace_seq
from t
where grp in ('start-of-group','end-of-group')
group by mob_id,
occurrenace_seq
order by mob_id,
occurrenace_seq
OCCURRENACE_SEQ MOB_ID START_MED END_MEDIA NO_OF_DAYS
1 39585 04-AUG-09 17-AUG-09 13
2 39585 20-AUG-09 26-AUG-09 6
3 39585 27-AUG-09 02-SEP-09 6
1 54988 05-AUG-09 26-AUG-09 21
1 69875 20-AUG-09
SQL> SY. -
Query hierarchy question (NW04s)
I assigned a hierarchy to 0GL_ACCOUNT and restrict on certain nodes just below the root.
How do I prevent these nodes from being expanded in query?You can set Hiearchy Properties either in Query Level or Hierarchy Maintenance Screen.
You need to enable check box for Expand Level to '1'.
Assign points if it helps.
Nagesh Ganisetti.
Assign points if it helps. -
Please help me with the proper query for the below problem
Hi,
I have a table RATE which have two columns RT_DATE (date) and RATES(number).
This table have following data.
RT_DATE
RATES
1-JAN-2007
7
2-MAR-2008
7.25
5-JAN-2009
8
8-NOV-2009
8.5
9-JUN-2010
9
I wanted to get the rate of interest on 8-DEC-2009.
Output will be 8.5 as this given date is in between 8-NOV-2009 and 9-JUN-2010. Could you please help me with proper query?
Regards,
Aparna SHi,
That sounds like a job for the LAST function:
SELECT MIN (rates) KEEP (DENSE_RANK LAST ORDER BY rt_date) AS eff_rate
FROM rate
WHERE rt_date < 1 + DATE '2009-12-08'
MIN above means that, in case of a tie (that is, 2 or more rows with the exact same latest rt_date) the lowest rates from that latest rt_date will be returned. In rt_date is unique, then it doesn't matter if you use MIN or MAX, but syntax demands that you use some aggregate function there.
I hope this answers your question.
If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for your sample data, and also post the results you want from that data.
Point out where the statement above is getting the wrong results, and explain, using specific examples, how you get the right results from the given data in those places.
Always say which version of Oracle you're using (e.g., 11.2.0.2.0).
See the forum FAQ: https://forums.oracle.com/message/9362002#9362002 -
Black bars above/below flv
Using Corel, I am coverting wmv's to flv's for import to Captivate 6. The videos play just fine but I have black bars above and below the video. I've tried changing the aspect ratio when converting the videos but I can't seem to get rid of the black bars.
Hi there
Do they play with the letterboxing when played outside of Captivate? My guess is that they will.
Odds are that you will need to find a different way to convert them. Maybe even play them on your computer and use Captivate Video Demo to capture them as they play.
Cheers... Rick -
Query required for below situation.
Hi All,
I have two table
T1 --> deal_site_id, subsection_id
T2 --> deal_site_id, subsection_id, catalog_id
requirement is first I need to check all the subsection_id in table T1 depending upon one deal_site_id.
Then what ever subsection_id I get from table T1 I need to check if those are available in table T2. If they are available then do nothing but if they are not available in table T2 then delete the row from table T1.
I've tried to write the query like below but stuck with exception.
DELETE FROM (SELECT * FROM T1 lid inner join T2 ld
ON LID.DEAL_SITE_ID = LD.DEAL_SITE_ID
WHERE lid.deal_site_id = 3070
AND LD.SUBSECTION_ID NOT IN (SELECT DISTINCT liod.subsection_id from T1 liod where liod.deal_site_id = 3070 )
this is giving me an exception like ORA-01752: cannot delete from view without exactly one key-preserved table
Please help me to write this query. Thanks in advance.
Regards,
Subhadeep
Edited by: sumajumd on Feb 2, 2012 3:08 AMHi, Subhadeep,
That sounds like:
DELETE FROM t1
WHERE deal_site_id = 3070 -- or whatever
AND subsection_id NOT IN (
SELECT subsection_id
FROM t2
WHERE deal_site_id = t1.deal_site_id
AND subsection_id IS NOT NULL -- If necessary
I hope this answers your question.
If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all the tables involved, and the results you want from that data.
In the case of a DML operation (such as DELETE) the sample data should show what the tables are like before the DML, and the results will be the contents of the changed table(s) after the DML.
Explain, using specific examples, how you get those results from that data.
Always say what version of Oracle you're using. -
Problem executing BEx query Hierarchy variable with default value
My query has hierarchy variable on 0MOVETYPE char with a default value . The 0MOVETYPE variabale restriction is in Static filter area.
I got timeout on query execution not because of amount of data but because of this hier. variable. Any ideas why?
Notes:
a) The hierarchy and the 0MOVETYPE characteristic are active and correct.
b) I've tried RSRT check, but got the same timeout error.
c) query executes fine on dev environment. I'm getting timeouts on PRD (as I say not because of amont of data)Hi,
1. Try generating the report in RSRT and see if query runs correctly
2. Looks like you are dafulating onto top node which contains whole data may be. This is not correct as it will definitely slow down the report based on amount of data it contains. Try to remove default and try first whether query is opening.
3. You can put some lower level defualt to understand whether amount of data is the issue.
4. Try to increase the server time out setting and see if it runs.
Thanks and regards -
Preview: How get rid of white space above/below screenshots?
My objective is to be able to make a composite screenshot by opening several and arranging their images on top of each other without unnecessary white space at the bottom and top of each of the pictures.
I did not have such top and bottom white space when I used Preview with Leopard 10.5.8 on an old G5, only now with Lion on a mid-2011 iMac.
Your counsel, please?
Respectfully, NormWhen the white space artifact appeared above and below each screenshot even before pasting into a composite, I thought it might be corruption of a preference but trashing of the 4 Preview plist files in Users/me/Library/Preferences did not fix it.
Your thoughts, please?
Maybe you are looking for
-
How do I read my wave form data back from an LVM file?
I collected a waveform and saved it using the LVM file format. I would like to read the waveform back into labview and display it with its timestamp and assigned name. The only way I could read the data back into Labview was to convert it to a number
-
How do i reset my security and privacy password
how can i reset my password from my security and privacy
-
Novice to Adobe video issue after encoding.
Hi Im very new to Adobe Premiere Pro and Adobe Media Encoder so I realise it might be something I havent or have done to give me my problem. Im attempting to create a Minecraft video for YouTube, Using Fraps as the recording program and Adobe Premier
-
PL/SQL Package importing from Flat Data files
Looking for sample PL/SQL package in importing data from flat data files into Oracle. Possible using the UTL_FILE.FOPEN and UTL_FILE.GET_LINE functions ?
-
Cannot make any outbound calls "internal error"
i can recieve calls but cannot make any outbound calls to mobile or landlines. Please help!