4 EA2 Group By advice is wrong if there is a column alias.
Given the following query
select snap_id,dbid, event,event_id, p1text, p1 file_no,sum(time_waited) time ,sum(p3) blocks
from dba_hist_active_sess_history
where event is not null
and p1text='file#'
group by snap_id,dbid, event,event_id, p1text, p1
order by snap_id, event
The select list is underlined in yellow and the suggested correction is to change the group by clause to
event, snap_id, p1text, event_id, dbid
As well as being in a bizarre order, it is missing p1.
If I remove the file_no column alias, it seems to work.
Reproduced, bugged.
Similar Messages
-
I need to recover deleted data from my iPhone 4S but don't have a recent backup. I thought by pressing sync on my macbook this would back up…but I was wrong. There are no backups on my macbook and the latest backup on iCloud was Jan 2012. My mum died in May and I had lots of text messages that I wanted to keep. I really want to get them back. Is there any way at all I can get that deleted data from the phone?
Since it has always been very basic to backup your computer and all it's data, Apple provides no way for you to transfer music from your iPhone back to your computer. As you know, you can re-download all iTunes purchases, but music that you ripped yourself you'll have to just re-rip again.
You can try and find 3rd party applications that might help you. I'm sure you'll pay, however.
Let this be a very important lesson learned.
Best. -
Bug 2679062 - Wrong results possible from multi-column INLIST - though stat
Hi,
The following test case is supplied in the metalink in bug no. 2871341, the base bug for this bug is 2679062.
REPRODUCIBILITY:
Reproduces constantly with simple test case below:
TEST CASE:
DROP TABLE A1
CREATE TABLE A1 (X1 VARCHAR2(10), X2 VARCHAR2(10))
REM *********** Create the second table: ***************
DROP TABLE A2
CREATE TABLE A2 (X1 VARCHAR2(10), X2 VARCHAR2(10))
INSERT INTO A1 VALUES ('1','2');
INSERT INTO A2 VALUES ('3','4');
COMMIT;
CREATE INDEX A1_X1 ON A1(X1 );
CREATE INDEX A1_X2 ON A1(X2);
CREATE INDEX A2_X1 ON A2(X1);
CREATE INDEX A2_X2 ON A2(X2);
CREATE OR REPLACE VIEW A_ALL AS SELECT * FROM A1 UNION ALL SELECT * FROM A2;
ANALYZE TABLE A1 COMPUTE STATISTICS;
ANALYZE TABLE A2 COMPUTE STATISTICS;
SELECT * FROM A_ALL;
SELECT * FROM A_ALL WHERE (X1='1' AND X2='2') ;
SELECT * FROM A_ALL WHERE ((X1='1' AND X2='2') OR (X1='3' AND X2='4'));
The 2nd query returns answer while the second is not !
The following is published in the 9.2.0.4 fixed bug list:
" 9204 - 2679062 - Wrong results possible from multi-column INLIST "
I have installed 9.2.0.4 patch set on a win 2000 machine Oracle and saw that the above case is actually solved but our application which has a very similar case doesn't.
After investigating I found the following test case that fails, it reproduces only when you have index on all columns (covering index):
drop table t1_1;
drop table t1_2;
create table t1_1(c1 number, c2 number, c3 number);
create table t1_2(c1 number, c2 number, c3 number);
create index t1_1_ix on t1_1(c1, c2, c3);
create index t1_2_ix on t1_2(c1, c2, c3);
create or replace view t1 as select * from t1_1 union all select * from t1_2;
insert into t1_1 values(1, 2, 100);
insert into t1_2 values(1, 2, 200);
commit;
analyze table t1_1 compute statistics;
analyze table t1_2 compute statistics;
prompt
prompt #######################################
prompt try 1 - works fine
prompt #######################################
prompt
select * from t1
where
(c1=1)
and
( (c2=2) and (c3=100)
prompt
prompt #######################################
prompt try 2 - works fine
prompt #######################################
prompt
select * from t1
where
(c1=1)
and
(c2=2) and (c3=200)
prompt
prompt #######################################
prompt try 3 - try 1 OR try 2 does not work !
prompt #######################################
prompt
select * from t1
where
(c1=1)
and
( ( (c2=2) and (c3=100) )
or
( (c2=2) and (c3=200) )
opened a TAR and wanted to share with you.
Tal Olier ([email protected]).Hi,
The following test case is supplied in the metalink in bug no. 2871341, the base bug for this bug is 2679062.
REPRODUCIBILITY:
Reproduces constantly with simple test case below:
TEST CASE:
DROP TABLE A1
CREATE TABLE A1 (X1 VARCHAR2(10), X2 VARCHAR2(10))
REM *********** Create the second table: ***************
DROP TABLE A2
CREATE TABLE A2 (X1 VARCHAR2(10), X2 VARCHAR2(10))
INSERT INTO A1 VALUES ('1','2');
INSERT INTO A2 VALUES ('3','4');
COMMIT;
CREATE INDEX A1_X1 ON A1(X1 );
CREATE INDEX A1_X2 ON A1(X2);
CREATE INDEX A2_X1 ON A2(X1);
CREATE INDEX A2_X2 ON A2(X2);
CREATE OR REPLACE VIEW A_ALL AS SELECT * FROM A1 UNION ALL SELECT * FROM A2;
ANALYZE TABLE A1 COMPUTE STATISTICS;
ANALYZE TABLE A2 COMPUTE STATISTICS;
SELECT * FROM A_ALL;
SELECT * FROM A_ALL WHERE (X1='1' AND X2='2') ;
SELECT * FROM A_ALL WHERE ((X1='1' AND X2='2') OR (X1='3' AND X2='4'));
The 2nd query returns answer while the second is not !
The following is published in the 9.2.0.4 fixed bug list:
" 9204 - 2679062 - Wrong results possible from multi-column INLIST "
I have installed 9.2.0.4 patch set on a win 2000 machine Oracle and saw that the above case is actually solved but our application which has a very similar case doesn't.
After investigating I found the following test case that fails, it reproduces only when you have index on all columns (covering index):
drop table t1_1;
drop table t1_2;
create table t1_1(c1 number, c2 number, c3 number);
create table t1_2(c1 number, c2 number, c3 number);
create index t1_1_ix on t1_1(c1, c2, c3);
create index t1_2_ix on t1_2(c1, c2, c3);
create or replace view t1 as select * from t1_1 union all select * from t1_2;
insert into t1_1 values(1, 2, 100);
insert into t1_2 values(1, 2, 200);
commit;
analyze table t1_1 compute statistics;
analyze table t1_2 compute statistics;
prompt
prompt #######################################
prompt try 1 - works fine
prompt #######################################
prompt
select * from t1
where
(c1=1)
and
( (c2=2) and (c3=100)
prompt
prompt #######################################
prompt try 2 - works fine
prompt #######################################
prompt
select * from t1
where
(c1=1)
and
(c2=2) and (c3=200)
prompt
prompt #######################################
prompt try 3 - try 1 OR try 2 does not work !
prompt #######################################
prompt
select * from t1
where
(c1=1)
and
( ( (c2=2) and (c3=100) )
or
( (c2=2) and (c3=200) )
opened a TAR and wanted to share with you.
Tal Olier ([email protected]). -
Group by with column alias does not work?
Hello,
The column alias is not working in the group clause?
select col1,col2-col3 "col23", sum(col4)
from table1
group by col1,col23
Error is col23 is invalid identifier.
Thank you.I guess it's the double quotes around bonus:
SQL> select empno, deptno, sum(bonus)
2 from
3 (
4 select empno, (sal + 500) bonus, deptno
5 from emp
6 )
7 group by empno, deptno
8 ;
EMPNO DEPTNO SUM(BONUS)
7900 30 1450
7369 20 1300
7499 30 2100
7521 30 1750
7566 20 3475
7654 30 1750
7698 30 3350
7782 10 2950
7788 20 3500
7839 10 5500
7844 30 2000
7876 20 1600
7902 20 3500
7934 10 1800
14 rows selected. -
What is wrong with adding a BLOB column?
What is wrong with adding a BLOB column?
SQL> alter table employee_dp add photo(blob(3000000);
alter table employee_dp add photo(blob(3000000)
ERROR at line 1:
ORA-00902: invalid datatype
SQL> alter table employee_dp add photo bolob(3000000);
alter table employee_dp add photo bolob(3000000)
ERROR at line 1:
ORA-01735: invalid ALTER TABLE optionHi jetq,
Don't give length.
SQL> alter table t add photo blob;
Table altered.Regards
Peter -
How do I check my security answers for my ID? I'm sure I have put them in correctly but Apple says they are wrong. There seems to be no facility to check what answers Apple has and I do not have a rescue e-mail address.
Read the article you linked
-
I accidently deleted a group from Address Book. Is there any way to retrieve it?
I accidentally deleted a group from Address Book. Is there any way to retrieve it?
Not unless you have a back up. Time Machine??
-
Software Update advice with wrong website address.
I've just received a Software Update notification, but the website given for obtaining further information appears to be wrong. After clicking it, I received the response "Document 307051 not found". The suggested search was also unsuccessful.
The updates offered were to Java for Mac OS X 10.4 Release 6 and Quick Time.
I'm hoping that somebody from Apple may see this and sort out the problem, but I can't rely on that. Has anyone got advice for me as to how else to draw the matter to Apple's attention?You didn't perchance ever visit a site that insisted you need a QT Player update to view Video did you? It intercepts some DNS requests & redirects, don't install it...
http://www.f-secure.com/v-descs/trojanosxdnschanger.shtml
I think some IMs do this as well as Spammers/Scammers.
If you need updates, or think you might, either use Software Update, or better yet visit Apple>downloads. -
Payment advice printing wrong address
Hello,
When i am printing Payment advices using PaymentRun program for Travel Mgmt,It is picking wrong address of the employee,i checked IT0006 and it is maintained properly.
can you please suggest where to check and from where Payment run program picks address. As i know address is maintined only in IT0006.
Any help will be appreciated.IF IT IS A Z YOU CAN OBTAIN ALL THE REGISTRIES IT0006 THAT ARE BETWEEN THE DATES OF THE PAYMENT AND CHOOSE THE PRESENT ONE
SAMPLE WITH IT0045
SELECT PERNR SUBTY OBJPS BEGDA ENDDA DARBT TILBT ANRTE SPRPS TILBG
APPENDING TABLE T_0045 FROM PA0045
WHERE PERNR eq P_PERNR AND
SUBTY IN R_SUBTY AND SPRPS NE'X' AND
( BEGDA BETWEEN V_BEGDA AND V_ENDDA OR
ENDDA BETWEEN V_BEGDA AND V_ENDDA ).
IF SY-SUBRC NE 0.
SELECT PERNR SUBTY OBJPS BEGDA ENDDA DARBT TILBT ANRTE SPRPS TILBG
APPENDING TABLE T_0045 FROM PA0045
WHERE PERNR eq P_PERNR AND
SUBTY IN R_SUBTY AND SPRPS NE'X' AND
ENDDA EQ '31129999' ).
ENDIF.
SORT T_0045 BY ENDDA PERNR SUBTY OBJPS DESCENDING . -
Replicating Product groups after client copy WRONG
Hi Folks,
I've taken a client copy from client 100 to 050 in both SRM SD1CLNT100 and ECC ED1CLNT100.
I've done BDLS to replace log. sys. in both systems for both SRM and ECC log sys. eg. ED1CLNT100 to 050 and SD1CLNT100 to 050.
After replication of config and product groups I'm stuck with the product groups replicateded in CLNT100.
I get the root node after replication of product groups in the new 050 client but all the product groups are not copied!
Any ideas to what I'm doing wrong?
Thanks in advance,
ThomasHI Thomas
Can you pls go through following replies ---
1 how to delete Product Category ?
2 Re: Updating Product Categories
3 Deletion of Product master on Production Client
Run transaction BDLS to convert logical system from old ID to new logical system ID. The logical system ID now would be PR3CLNT700
regards,
Nimish Sheth -
Has anyone else had Library incorrectly group photos in the wrong year?
Hi All
I have just noticed, after installing iPhoto 06, that the app has sorted over 4,000 of my pics in to a '2006' folder. I like taking photos but not 4,000 in 34 days! Nearly all these photos were taken in 2005 (there are separate folders in my library for 2005, '04, '03 and earlier).
I tried moving the pics in to the correct year folder but that did not work. Has anyone else experienced this problem?
Cheers
Simon
iMac G5 Mac OS X (10.4.2)I have a similar (maybe same) problem. I just got a new iMac and imported 9000 images from my external harddrive. Images had been accessed via my WIndox XP computer.
iPhoto imported images but put several hundred pictures into the wrong "year" folder. 300 pics taken on a 2001 vacation were put into a year 2000 folder (didn't even have a camera in 2000). Some pics taken in 2001 were put into the 2002 folder.
Can I manually take the pictures from the original/modified 2000 folder and move them into the 2001 folder, ... ?
Anyone? -
I have bought a New Computer as my Old one did it's HDD. I now have windows 8/64 bit I/E 10 and am trying to Authorise my New Computer. I have downloaded the latest version and I got an ""unknown error -42110 "" .I went to te apple website and that says how to deactivate a SC folder or something in windows 7 or windows vista.
It also says to go to ""store|"" > Authorise Computer"" and I can't get anything,so I contacted Apple support and I got some person called Gulab who sent me links to the same obsolete apple website which says exactly what I have said above.
I open iTunes and it lets me login with my apple id and says that I have $78.00 in credit and to be honest I can't understand the updated version/s let alone find how to ""Authorise "" my new computer.Gulab said to delete te sc Folder but the website (Apple) says this ios for windows 7 and windows vista.
Running around in circles. Apple website needs to be drastically updated instead of updating iTunes .
Completely confused and so is the support staff....lololooolololol(1) There's a couple of ways to get through to the authorisation controls in the 11.0.x versions.
The control is still in the Store menu, but first (if you're using iTunes versions 11.0.x) you might need to bring up the menu bar to see the Store menu.
If you're using 11.0.x, click on the wee boxy icon up in the top-left corner of your iTunes to see the "Show Menu Bar" control, as per the following screenshot:
Then you'll find the control in the Store menu:
Alternatively, if you don't want to bring up the menu bar, it's still possible to get into the authorise controls via nested menus accessible from the wee boxy icon. Here's a screenshot of where to find them:
(2) Some discussion on means of locating the SC Info folder on Windows 8 systems in the following topic:
TS1389 Re: How can you do this in windows 8? -
OBIEE 10g Getting wrong results when adding calculated columns to a report
Hi,
I'm experiencing a possible misbehaviour with OBIEE 10g (10.1.3.4.1).
I have a simple report with a table. Columns are simply selected from dimensions and facts. In this case the generated query is:
WITH
SAWITH0 AS (select sum(T30604.TOTAL_TIME) as c1,
sum(T30604.MATERIALS_QTT_COST) as c2,
sum(T30604.AMNT) as c3,
sum(T30604.QNTY) as c4,
T30622.BRANCH_CODE as c5,
T25064.SRP1_CODE as c6,
T25064.SRP1_DESC as c7,
T25064.SRP2_CODE as c8
from
THK_BRANCHES T30622,
THK_ITEMS T25064,
THK_INVENTORY_TRANSACTIONS T30604
where ( T25064.ITEM_ID = T30604.ITEM_ID and T30604.BRANCH_ID = T30622.BRANCH_ID )
group by T25064.SRP1_CODE, T25064.SRP1_DESC, T25064.SRP2_CODE, T30622.BRANCH_CODE)
select distinct SAWITH0.c5 as c1,
SAWITH0.c6 as c2,
SAWITH0.c7 as c3,
SAWITH0.c8 as c4,
SAWITH0.c4 as c5,
SAWITH0.c3 as c6,
SAWITH0.c2 as c7,
SAWITH0.c1 as c8,
SAWITH0.c4 as c9,
SAWITH0.c3 as c10,
SAWITH0.c2 as c11,
SAWITH0.c1 as c12,
SAWITH0.c4 as c13,
SAWITH0.c3 as c14,
SAWITH0.c2 as c15,
SAWITH0.c1 as c16,
SAWITH0.c4 as c17,
SAWITH0.c3 as c18,
SAWITH0.c2 as c19,
SAWITH0.c1 as c20
from
SAWITH0
Results of this report / query are correct.
I then add a simple calculation (subtraction between two fields). The generated query is:
WITH
SAWITH0 AS (select sum(T30604.MATERIALS_QTT_COST) as c1,
sum(T30604.AMNT) as c2,
T30622.BRANCH_CODE as c3,
T25064.SRP1_CODE as c6,
T25064.SRP1_DESC as c7,
sum(T30604.TOTAL_TIME) as c8,
sum(T30604.QNTY) as c11,
T25064.SRP2_CODE as c12
from
THK_BRANCHES T30622,
THK_ITEMS T25064,
THK_INVENTORY_TRANSACTIONS T30604
where ( T25064.ITEM_ID = T30604.ITEM_ID and T30604.BRANCH_ID = T30622.BRANCH_ID )
group by T25064.SRP1_CODE, T25064.SRP1_DESC, T25064.SRP2_CODE, T30622.BRANCH_CODE),
SAWITH1 AS (select D1.c1 as c1,
D1.c2 as c2,
D1.c3 as c3,
D1.c4 as c4,
D1.c5 as c5,
D1.c6 as c6,
D1.c7 as c7,
D1.c8 as c8,
D1.c9 as c9,
D1.c10 as c10,
D1.c11 as c11,
D1.c12 as c12
from
(select sum(SAWITH0.c1) over (partition by SAWITH0.c3) as c1,
sum(SAWITH0.c2) over (partition by SAWITH0.c3) as c2,
SAWITH0.c3 as c3,
sum(SAWITH0.c1) over (partition by SAWITH0.c6, SAWITH0.c3) as c4,
sum(SAWITH0.c2) over (partition by SAWITH0.c6, SAWITH0.c3) as c5,
SAWITH0.c6 as c6,
SAWITH0.c7 as c7,
sum(SAWITH0.c8) over (partition by SAWITH0.c6, SAWITH0.c12, SAWITH0.c3) as c8,
sum(SAWITH0.c1) over (partition by SAWITH0.c6, SAWITH0.c12, SAWITH0.c3) as c9,
sum(SAWITH0.c2) over (partition by SAWITH0.c6, SAWITH0.c12, SAWITH0.c3) as c10,
sum(SAWITH0.c11) over (partition by SAWITH0.c6, SAWITH0.c12, SAWITH0.c3) as c11,
SAWITH0.c12 as c12,
ROW_NUMBER() OVER (PARTITION BY SAWITH0.c3, SAWITH0.c12 ORDER BY SAWITH0.c3 ASC, SAWITH0.c12 ASC) as c13
from
SAWITH0
) D1
where ( D1.c13 = 1 ) ),
SAWITH2 AS (select sum(T30604.MATERIALS_QTT_COST) as c1,
sum(T30604.AMNT) as c2
from
THK_INVENTORY_TRANSACTIONS T30604)
select SAWITH1.c3 as c1,
SAWITH1.c6 as c2,
SAWITH1.c7 as c3,
SAWITH1.c12 as c4,
SAWITH1.c11 as c5,
SAWITH1.c10 as c6,
SAWITH1.c9 as c7,
SAWITH1.c8 as c8,
SAWITH1.c10 - SAWITH1.c9 as c9,
SAWITH1.c11 as c10,
SAWITH1.c10 as c11,
SAWITH1.c9 as c12,
SAWITH1.c8 as c13,
SAWITH1.c11 as c15,
SAWITH1.c10 as c16,
SAWITH1.c9 as c17,
SAWITH1.c8 as c18,
SAWITH1.c11 as c20,
SAWITH1.c10 as c21,
SAWITH1.c9 as c22,
SAWITH1.c8 as c23,
SAWITH1.c5 as c26,
SAWITH1.c4 as c27,
SAWITH1.c2 as c28,
SAWITH1.c1 as c29,
SAWITH2.c2 as c30,
SAWITH2.c1 as c31
from
SAWITH1,
SAWITH2
Results of this report / query are wrong: it seems as if some rows "disappear".
If I delete the filter in SAWITH1 query above ( D1.c13 = 1 ) results are correct.
Anyone experiencing the same problem? The strange thing is that I have a number of similar reports (on other subject areas) and everyting is working fine.
Please also note that I don't want to add this kind of calculated items in the RPD (they can be simple calculations that are made on-the-fly).
Any help would be greatly appreciated.
Thanks a lot and regards,
CristinaI have the same issue, everything OBIEE server generate query using ROW_NUMBER() over () function, it will hardcode Dx.cx = 1, this will cause issue if you have rows of the same distinct value, thus causing missing rows and the final results will be wrong.
I have open a SR with Oracle Support since March 2011, but till today, they have not resolve the issue yet.
Hope they solve the issue soon.
Best Regards
KT -
Hey everyone, i have this query
SELECT SUM(SalesPrice * ScheduleQuantity) AS revenue, AccountName
this returns a whole lot of null values in the revenue column. Tried using
(NOT revenue IS NULL))
to get rid of them but it isnt workin and my brain has officially went on strike. Any advice would be goodhow about something like:
SELECT SUM(nvl(SalesPrice, 0) * nvl(ScheduleQuantity, 0)) revenue, AccountName
FROM table
GROUP BY AccountName;or perhaps
SELECT revenue, AccountName
FROM (SELECT SUM(SalesPrice * ScheduleQuantity) revenue, AccountName
FROM table
GROUP BY AccountName)
WHERE revenue IS NOT NULL;or even
SELECT SUM(SalesPrice * ScheduleQuantity) revenue, AccountName
FROM table
GROUP BY AccountName
HAVING SUM(SalesPrice * ScheduleQuantity) IS NOT NULL;depending on what you're wanting to see.
Message was edited by:
Boneist -
My iphone will not sync music, I have done it many times before , there is 4,6 GB space it just remains stuck at step 6 of 6 for over an hour, any ideas what is wrong?
You may need to do a Restart or Reset
http://support.apple.com/kb/ht1430
Maybe you are looking for
-
How to track all Z in a session ?
Hi Gurus, I was looking for similar treads and couldn't find any... so, lets try your help. We are planning to update our ECC6.0 from stack 8 to 18 and only install (not activate) EHP4 in 2011Q1. Unfortunately there are more than 2,000 customer speci
-
Hi I am creating a flash animation to be projected. I have to burn in onto a dvd. I have tried converting the .mov file that flash exports, and flv to mpeg. The preview looks fine, but every time the dvd quality is terrible. I have tried HD, h. 264,
-
Performance Problems by using a subreport with a SAP BW Query
Hello Experts, we have the following scenario: - Crystal Reports Report (CRR) on top of a SAP BW Query - SAP BW Query contains a member structure with Month, Year, Prior Year and total If I now put some details of a dataset in the main report (e.g. k
-
Need Help with 29.97i Footage
I searched the forums here for an answer, but was unable to find anything. Hopefully someone here can help me. I'm a student just learning the Adobe Production Suite. My class just shot its first film short. We used 16mm @ 24fps. The telecine process
-
Hi, I'd like to place Guest Accounts in a different "UserGroup" depending on the base country of the sponsor, which is meantion in the LDAP CN-String used to authenticate sponsors. Unfortunately, the ISE (1.2, Patch Level 5) only provides the operato