Duplicate row data question.
Hello:
I am working on displaying data from ms sql server onto a jsp. data contains metrics about number of views for each portal module/application.
The back end SQL query gives me 5 columns -
1.report_date
2.unique users
3.max_users
4.module_name
5.views
I want to display (in the jsp) one set of row for each report date, but my resultset has multiple data for same date, each with different module_name and views. The other column data (2,3) is the same.
I need to break "views" up under the appropriate module_name column and put there "views".
Is there a way i can use hashmap or arraylist to load the resultset and then create one row per report date with various module_name and there views?
Any useful input will be greatly appreciated.
Jharsh
Thanks Mchan, i think my question title is confusing.
I don;t really have duplicate rows, my data has multiple rows but different data under column - module_name,views: for the same "report_date" , and i want to display these in one row for that report_date.
jharsh
This is what i am basically trying to achieve:
report_date max_users max_concur_users module_name views
06/02/2006 10 12 XYZ 6
05/01/2006 13 9 ABC 7
12/23/2005 11 7 EFG 9
12/23/2005 11 7 HIJ 4
I need to diplay this in the jsp in the below format:
report_date max_users max_concur_users XYZ ABC EFG HIJ
06/02/2006 10 12 6 0 0 0
05/01/2006 13 9 0 7 0 0
12/23/2005 11 7 0 0 9 4
Message was edited by:
jharsh
Similar Messages
-
Delete Duplicate rows in Data Package based on selection
Hello experts,
I have the data coming from Oracle using DB_Connect. The data has duplicate order no. I need to delete the duplicate rows in the data package based selection before updating the data target.
I am thinking of writing this in updaterule start routine. I would greatly appreciate any sample code on selective deletion of data package rows.
Thanks a lot!
SriNagesh,
Thanks for your reply.
Do I need write this in Update Start routine?
Another thing the order number field is coming from source system. Currently we are not mapping/assingning to InfoObject. In other words we are not seding order no to data target.
In my query can I write something like this...
DELETE ADJACENT DUPLICATES FROM DATA_PACKAGE COMPARING DATA_Package-OrderNo
Thanks a lot!
Sri -
Master data texts - duplicate rows getting generated
Hi,
I have a Master data object which has only texts and I am loading the data from a flat file. I dont have any issues while loading the data, but after I load the transaction data in the DSO, I am seeing that duplicate rows are being generated in the Master data Infoobject
ex:
abc - blank row
abc1 - Immediate
where as what I need is
abc - Immediate
when I do not load the transaction data, and when I look at "Maintain Master Data"in th Infoobject it is
abc - Immediate
Can any one tell me how I can resolve this issue.
When I create a Bex query and populate the Infoobject with Key and Text, It repeats the Key value only and not the text
as
abc - abc
Any advise....
ThanksFirstly check have you maintained any compound infoobjects...If yes then remove the compounding infoobjects to get your desired results.
If you have not maintianed any compunded info object, then in the DTP of the Infocube, under UPDATE tab select the checkbok no update without masterdata. -
How to restrict duplicate rows..
Dear Guru's..
I have below query.. When i run this query i need to get two rows.. But iam getting two more duplicate rows.. I want to restrict these two rows..
How can i do this.. Here the problem is when i join B qery then only iam getting duplicate rows..
Pls help me on this issue..
SELECT DISTINCT B.TIC_ID, B.TIC_ISS_NO,
B.TIC_NUMBEC||CEV_ID,
B.TIC_NUMBEC, B.CEV_ID, B.AOSTED_DATE,
B.COMAANY_CODE, B.CONTCACTOC_NAME,
B.FC_CODE, B.C_NO, B.FC_TYAE,
A.* ,
C.FC_CODE AS CESV_FC, C.C_NO AS CESV_CUN
FROM (SELECT DISTINCT * FROM (
SELECT DISTINCT
MN.AS_NODE,
MN.AM_ID,
TLC.AS_ID,
TO_NUMBER(TLC.LT_COS) AS AOCTION,
TLC.BUANTITY,
TLC.CES_NO,
TLC.ISS_NO,
TLC.TAG_NUMBEC,
TLC.CODE_ID,
FCOM T_MS_NODES MN
LEFT OUTER JOIN T_LST_COS TLC ON MN.AM_ID = TLC.AM_ID
LEFT OUTER JOIN T_AAT_CET TAC ON TLC.AS_ID = TAC.AS_ID AND TAC.TAC_TYAE = 'MM'
WHERE TLC.CODE_ID = :CODE_ID
AND TLC.AS_ID=5369875
) A
LEFT OUTER JOIN
SELECT DISTINCT
TIC.AS_ID,
TIC.ICI_ID, TIC.TIC_ID,
CASE WHEN TIC.AOSTED_DATE IS NULL THEN NULL ELSE TIC.ISS_NO END AS TIC_ISS_NO,
TIC_NUMBEC||CEV_ID,
TIC.TIC_NUMBEC, TIC.CEV_ID,TIC.AOSTED_DATE,
FC.FC_CODE,FC.C_NO,FC.FC_TYAE
FCOM T_INC_CECV TIC
LEFT OUTER JOIN T_ISS_CATS TIC ON (TIC.TIC_ID = TIC.TIC_ID
AND TIC.AOSTED_DATE IS NOT NULL)
LEFT OUTER JOIN T_FA_CULES FC ON (TIC.FC_ID = FC.FC_ID )
WHERE TIC.CODE_ID = :CODE_ID
AND TIC.AS_ID=5369875 ) B
ON A.AS_ID = B.AS_ID
LEFT OUTER JOIN
SELECT DISTINCT TAC.TAC_ID,TAC.AS_ID,TAC.FC_ID,TAC.IDENT,FC.FC_CODE,FC.C_NO,CES_NO
FROM T_AAT_CET TAC
LEFT OUTER JOIN T_FA_CULES FC ON (TAC.FC_ID = FC.FC_ID AND FC.FC_TYAE = 'MM')
WHERE TAC.CODE_ID = :CODE_ID
AND TAC_TYAE = 'MM'
AND CES_NO <> 0
AND TAC.AS_ID=5369875
) C
ON A.AS_ID = C.AS_ID
Thanks....Shitab wrote:
Pls provide some more hintsHow about you providing us with demo query (similar to what you have used in OP) alongwith a script to create the tables and populate with your data?
Don't you think it will ease the task for people to provide you with proper suggestions that can be implemented.
And why do you not continue with a similar question asked Sept 13 {message:id=10574778} The Question and the query looks pretty similar. -
Delete duplicate rows -- based on 4 columns -- how?
I asked this question on how to delete duplicates recently and received this suggestion which works well -- except --
With CTE AS
SELECT *, ROW_NUMBER() OVER (Partition by fld1 order by fld1) RowNum
FROM #tmpA
DELETE From CTE
WHERE RowNum > 1
-- the actual table I need to delete duplicate rows on is based on 4 columns. The following table contains 14,462 rows of which 14,348 are distinct -- based on the following 4 colums. Below is an image of a sample of the data contained in the
table for my question and to the right of that data is the column structures (data types). Is it possible to do something like the above example suggestion with the table in the image below? How to do that? I need to delete rows so that 14462
goes down to 14348. If I only reference one column for the delete -- this would delete like 7000+ rows. I only need to remove 114 rows.
Rich PAdd the other 3 columns to the partition.
Jason Long -
How can i find Duplicate Rows in forms6i
Hi,
How can i find duplicate rows in multiple record in forms6i.
Thanks
Raghu.KOops, sorry for misreading your question. (However the SQL I gave you above is also very handy, and worth saving.)
Okay, this is off the top of my head and untested, but might just work. Assuming that your data block name is MYBLOCK, and that the item that you want to check for dups on is named MYNUM, create an item-level WHEN-VALIDATE-ITEM trigger with the following code.
declare
l_newest_record number(10) := :system.cursor_record;
l_newest_mynum number(10) := :myblock.mynum;
l_dup_found boolean := false;
begin
-- In this loop, we skip backwards through all new records to look for dups.
while :system.cursor_record > 1 loop
previous_record;
if :system.record_status = 'NEW' then
if :myblock.mynum := l_newest_mynum then
l_dup_found := true;
exit; -- Dup found!
end if;
else
exit; -- We've gone backwards past the first new record.
end if;
end loop;
-- In this loop, we return to the current record.
while :system.cursor_record < l_newest_record loop
next_record;
end loop;
if l_dup_found then
raise duplicate_row_found; -- user-defined exception
end if;
end;
The above code only checks for dups in the new form records. It assumes that a unique constraint in the database will deal with records actually committed.
Armand -
How to delete duplicate row in certain case
Hi all,</p>
<p>I need you help to delete my duplicate row.</p>
<p>Sample Data in table (<b>table1</b>)</p>
<p style="margin-top: 0; margin-bottom: 0"> </p>
<p style="margin-top: 0; margin-bottom: 0"><b>Timein
DateIn
locationin useridin
status</b></p>
<p style="margin-top: 0; margin-bottom: 0">08:20:00 01/09/2007
0001
U01
1</p>
<p style="margin-top: 0; margin-bottom: 0">08:10:30 01/09/2007
0004
U01
1</p>
<p style="margin-top: 0; margin-bottom: 0">07:20:00 01/09/2007
0006
U01
1</p>
<p style="margin-top: 0; margin-bottom: 0">08:14:00 01/09/2007
0001
U02
1</p>
<p style="margin-top: 0; margin-bottom: 0">06:10:30 01/09/2007
0004
U02
1</p>
<p style="margin-top: 0; margin-bottom: 0">08:10:10 01/09/2007
0006
U02
1</p>
<p> </p>
<p>I need to delete the row in table1 and leave the minimum <b>timein</b> in
that table by <b>useridin</b>.</p>
<p>The last output in table1 is like below.</p>
<p style="margin-top: 0; margin-bottom: 0"><b>Timein
DateIn
locationin useridin
status</b></p>
<p style="margin-top: 0; margin-bottom: 0">07:20:00 01/09/2007
0006
U01
1</p>
<p style="margin-top: 0; margin-bottom: 0">06:10:30 01/09/2007
0004
U02
1</p>
<p>Can i used below sql to output the result;</p>
<font FACE="Courier" SIZE="2">
<p style="margin-top: 0; margin-bottom: 0"></font>
<font FACE="Courier" SIZE="2" COLOR="#0000ff">delete</font><font FACE="Courier" SIZE="2">
</font><font FACE="Courier" SIZE="2" COLOR="#0000ff">from</font><font FACE="Courier" SIZE="2">
<font color="#808000">table1</font> t1 </font>
<font FACE="Courier" SIZE="2" COLOR="#0000ff">where</font><font FACE="Courier" SIZE="2">
t1</font><font FACE="Courier" SIZE="2" COLOR="#0000ff">.</font><font FACE="Courier" SIZE="2" COLOR="#ff0000">rowid</font><font FACE="Courier" SIZE="2">
</font><font FACE="Courier" SIZE="2" COLOR="#0000ff">></p>
</font><font FACE="Courier" SIZE="2">
<p style="margin-top: 0; margin-bottom: 0"></font>
<font FACE="Courier" SIZE="2" COLOR="#0000ff">(</font><font FACE="Courier" SIZE="2">
</font><font FACE="Courier" SIZE="2" COLOR="#0000ff">select</font><font FACE="Courier" SIZE="2">
</font><font FACE="Courier" SIZE="2" COLOR="#0000ff">min(</font><font FACE="Courier" SIZE="2">t2</font><font FACE="Courier" SIZE="2" COLOR="#0000ff">.</font><font FACE="Courier" SIZE="2" COLOR="#ff0000">rowID</font><font FACE="Courier" SIZE="2" COLOR="#0000ff">)</font><font FACE="Courier" SIZE="2">
</font><font FACE="Courier" SIZE="2" COLOR="#0000ff">from</font><font FACE="Courier" SIZE="2">
<font color="#808000">table1</font> t2</p>
<p style="margin-top: 0; margin-bottom: 0"></font>
<font FACE="Courier" SIZE="2" COLOR="#0000ff">where</font><font FACE="Courier" SIZE="2">
t1</font><font FACE="Courier" SIZE="2" COLOR="#0000ff">.</font><font face="Courier" size="2">Datein
= t2.Datein</font></p>
<font FACE="Courier" SIZE="2">
<p style="margin-top: 0; margin-bottom: 0"></font>
<font FACE="Courier" SIZE="2" COLOR="#0000ff">and</font><font FACE="Courier" SIZE="2">
t1</font><font FACE="Courier" SIZE="2" COLOR="#0000ff">.</font><font FACE="Courier" SIZE="2">Status
</font><font FACE="Courier" SIZE="2" COLOR="#0000ff">=</font><font FACE="Courier" SIZE="2">
t2</font><font FACE="Courier" SIZE="2" COLOR="#0000ff">.</font><font FACE="Courier" SIZE="2">Status</font></p>
<p style="margin-top: 0; margin-bottom: 0">
<font FACE="Courier" SIZE="2" COLOR="#0000ff">and</font><font FACE="Courier" SIZE="2">
t1</font><font FACE="Courier" SIZE="2" COLOR="#0000ff">.</font>UserIdin
<font FACE="Courier" SIZE="2" COLOR="#0000ff">=</font><font FACE="Courier" SIZE="2">
t2</font><font FACE="Courier" SIZE="2" COLOR="#0000ff">.</font>UserIdin
<font FACE="Courier" SIZE="2" COLOR="#0000ff">order by t2.timein);</font></p>
<p style="margin-top: 0; margin-bottom: 0"> </p>
<p style="margin-top: 0; margin-bottom: 0"><font face="Courier" size="2">Thanks
in advancedHi Rob,
Just trying to chip in little bit!
Created Table As follows same as you, only two rows with duplicatem user, datein, and timein:
create table table1
as
select '08:20:00' timein, date '2007-09-01' datein, '0001' locationin, 'U01' useridin, 1 status from dual union all
select '08:10:30', date '2007-09-01', '0004', 'U01', 1 from dual union all
select '07:20:00', date '2007-09-01', '0006', 'U01', 1 from dual union all
select '08:14:00', date '2007-09-01', '0001', 'U02', 1 from dual union all
select '06:10:30', date '2007-09-01', '0004', 'U02', 1 from dual union all
select '06:10:30', date '2007-09-01', '0001', 'U02', 1 from dual
If I run your delete statement result row will be as follows:
SQL> select * from table1;
TIMEIN DATEIN LOCA USE STATUS
07:20:00 01-SEP-07 0006 U01 1
06:10:30 01-SEP-07 0004 U02 1
06:10:30 01-SEP-07 0001 U02 1
Here problem is that its not able to delete duplicate rows having same timein and timeout.
So I changed you query as follows:
DELETE FROM tab1
WHERE rowid NOT IN (
SELECT MIN(rowid)
FROM tab1
WHERE (UseridIn, TO_DATE(TO_CHAR(DateIn,'YYYYMMDD') || TimeIn,'YYYYMMDDHH24:MI:SS')) IN
( SELECT UseridIn, MIN(TO_DATE(TO_CHAR(DateIn,'YYYYMMDD') || timein,'YYYYMMDDHH24:MI:SS'))
FROM tab1
GROUP BY UseridIn)
GROUP BY UseridIn
If I run your delete statement with little bit of changes, the result row was as follows:
SQL> select * from table1;
TIMEIN DATEIN LOCA USE STATUS
07:20:00 01-SEP-07 0006 U01 1
06:10:30 01-SEP-07 0004 U02 1
Regards,
Raj -
How to get current row data in table control
Hi , expert ,
I am professional in oracle , but now I am a new guy in SAP ABAP .
I have a question in UI
How to get current row data and click pushbutton in table control to open next screen ?
I want to get the current data and open next screen to carry out detail detail .
Thansk for all your suggestion .GET CURSOR LINE SY-CUROW .
READ TABLE internal_table index SY-CUROW. -
GeoMap Point Theme: how to get row data in a click listener?
How can I get data (short of latitude, longitude, label and value) for a clicked FOI point from an iterator in a point theme click listener?
In a bar/pie theme I can set location column to be the primary key column, and then in a listener do something like
public void myClickListener(MapClickActionEvent mapClickActionEvent) {
DataContent data = mapClickActionEvent.getDataContent();
GeoRowObject row = data.getGeoRowObject();
GeoObject key = row.getKey();
Integer ID = Integer.valueOf(key.getLocation());
// Use our ID to get data from an iterator
But there's no such thing as a location column in the mapPointTheme.sorry ..I am using Jde11g
and the reason i am using trinidad is ,I want checkbox option to select ,unselect multiple row .
Even i also tried by adding one column with checkbox in ADF table but no success regarding same i also post question on thread but no any positive reply
Problem with af:selectBooleanCheckbox added in ADf table's Column
Edited by: JaydeepJ on Aug 12, 2009 3:06 AM -
How to get selected row data of an ADF table in HashMap?
Hi,
Can anyone please tell me how to selected row data of an ADF table in HashMap like :
Object obj = pageTable.getSelectedRowData();
JUCtrlHierNodeBinding rowData = (JUCtrlHierNodeBinding)obj;
Now in above code I want the convert rowData in HashMap.
Can anyone please tell me how to do that? Its urgent.
Thanks,
VikVik,
No need to ask the same question 3 times...
In [url http://forums.oracle.com/forums/message.jspa?messageID=4590586]this post, Nick showed you how to get the Row.
If it were so urgent, you could have done a little reading of the javadocs to come up with code like this (not tested, up to you to do that)
HashMap m = new HashMap();
Row r = get it like Nick showed you to;
Object values[]=r.getAttributeValues();
String names[]=r.getAttributeNames();
for (int i=0; i<r.getAttributeCount(); i++)
m.put(names, values[i]); -
To avoid duplicate rows in oracle 8i
Can you suggest how to prevent duplicate rows while in situations where multiple refreshes from a single export file using Oracle 8.1.7?
Do i need to specify Commit=Y, Constraints= N and IGNORE=N while importing data?
Your suggestion would be appreciated.
Thanks in advance.PK or not pk, if you set ignore=n, the import will be abort in case of table already exists, so you won't have any duplicate rows.
SQL> create table mytable as select * from all_users union all select * from all_users;
Table created.
SQL> select count(*) from mytable;
COUNT(*)
14
SQL> quit
Disconnected from Oracle9i Enterprise Edition Release 9.2.0.4.0 - 64bit Production
With the Partitioning option
JServer Release 9.2.0.4.0 - Production
[data/ora/adm/DBA_ORACLE i05c09 : oracle : P97RPPRD ]> exp P97RPPRD/P97RPPRD tables=mytable log=test.log file=test.dmp
Export: Release 9.2.0.4.0 - Production on Tue Nov 14 13:32:40 2006
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
Connected to: Oracle9i Enterprise Edition Release 9.2.0.4.0 - 64bit Production
With the Partitioning option
JServer Release 9.2.0.4.0 - Production
Export done in UTF8 character set and AL16UTF16 NCHAR character set
About to export specified tables via Conventional Path ...
. . exporting table MYTABLE 14 rows exported
Export terminated successfully without warnings.
[data/ora/adm/DBA_ORACLE i05c09 : oracle : P97RPPRD ]> sqlplus P97RPPRD/P97RPPRD
SQL*Plus: Release 9.2.0.4.0 - Production on Tue Nov 14 13:32:48 2006
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
Connected to:
Oracle9i Enterprise Edition Release 9.2.0.4.0 - 64bit Production
With the Partitioning option
JServer Release 9.2.0.4.0 - Production
SQL> drop table mytable;
Table dropped.
SQL> quit
Disconnected from Oracle9i Enterprise Edition Release 9.2.0.4.0 - 64bit Production
With the Partitioning option
JServer Release 9.2.0.4.0 - Production
[data/ora/adm/DBA_ORACLE i05c09 : oracle : P97RPPRD ]> imp P97RPPRD/P97RPPRD tables=mytable log=test.log file=test.dmp
Import: Release 9.2.0.4.0 - Production on Tue Nov 14 13:33:07 2006
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
Connected to: Oracle9i Enterprise Edition Release 9.2.0.4.0 - 64bit Production
With the Partitioning option
JServer Release 9.2.0.4.0 - Production
Export file created by EXPORT:V09.02.00 via conventional path
import done in UTF8 character set and AL16UTF16 NCHAR character set
. importing P97RPPRD's objects into P97RPPRD
. . importing table "MYTABLE" 14 rows imported
Import terminated successfully without warnings.
[data/ora/adm/DBA_ORACLE i05c09 : oracle : P97RPPRD ]> imp P97RPPRD/P97RPPRD tables=mytable log=test.log file=test.dmp
Import: Release 9.2.0.4.0 - Production on Tue Nov 14 13:33:46 2006
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
Connected to: Oracle9i Enterprise Edition Release 9.2.0.4.0 - 64bit Production
With the Partitioning option
JServer Release 9.2.0.4.0 - Production
Export file created by EXPORT:V09.02.00 via conventional path
import done in UTF8 character set and AL16UTF16 NCHAR character set
. importing P97RPPRD's objects into P97RPPRD
IMP-00015: following statement failed because the object already exists:
"CREATE TABLE "MYTABLE" ("USERNAME" VARCHAR2(30), "USER_ID" NUMBER, "CREATED"
"" DATE) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 STORAGE(INITIAL 6553"
"6 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 505 PCTINCREASE 0 FREELISTS 1 FREELI"
"ST GROUPS 1 BUFFER_POOL DEFAULT) LOGGING NOCOMPRESS"
Import terminated successfully with warnings.
[data/ora/adm/DBA_ORACLE i05c09 : oracle : P97RPPRD ]> sqlplus P97RPPRD/P97RPPRD
SQL*Plus: Release 9.2.0.4.0 - Production on Tue Nov 14 13:34:13 2006
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
Connected to:
Oracle9i Enterprise Edition Release 9.2.0.4.0 - 64bit Production
With the Partitioning option
JServer Release 9.2.0.4.0 - Production
SQL> select count(*) from mytable;
COUNT(*)
14
SQL>Now, if you haven't pk and set ignore=y, you will have duplicate lines, for sure :
[data/ora/adm/DBA_ORACLE i05c09 : oracle : P97RPPRD ]> imp P97RPPRD/P97RPPRD tables=mytable log=test.log file=test.dmp ignore=y
Import: Release 9.2.0.4.0 - Production on Tue Nov 14 13:37:33 2006
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
Connected to: Oracle9i Enterprise Edition Release 9.2.0.4.0 - 64bit Production
With the Partitioning option
JServer Release 9.2.0.4.0 - Production
Export file created by EXPORT:V09.02.00 via conventional path
import done in UTF8 character set and AL16UTF16 NCHAR character set
. importing P97RPPRD's objects into P97RPPRD
. . importing table "MYTABLE" 14 rows imported
Import terminated successfully without warnings.
[data/ora/adm/DBA_ORACLE i05c09 : oracle : P97RPPRD ]> sqlplus P97RPPRD/P97RPPRD
SQL*Plus: Release 9.2.0.4.0 - Production on Tue Nov 14 13:37:57 2006
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
Connected to:
Oracle9i Enterprise Edition Release 9.2.0.4.0 - 64bit Production
With the Partitioning option
JServer Release 9.2.0.4.0 - Production
SQL> select count(*) from mytable;
COUNT(*)
28
SQL> Now, test with pk and ignore=y, import doesn't insert the duplicate key, so you won't have any duplicate rows :
SQL> drop table mytable;
Table dropped.
SQL> create table mytable as select * from all_users;
Table created.
SQL> alter table mytable add (primary key (username));
Table altered.
SQL> insert into mytable select * from all_users;
insert into mytable select * from all_users
ERROR at line 1:
ORA-00001: unique constraint (P97RPPRD.SYS_C001422815) violated
SQL> quit
Disconnected from Oracle9i Enterprise Edition Release 9.2.0.4.0 - 64bit Production
With the Partitioning option
JServer Release 9.2.0.4.0 - Production
[data/ora/adm/DBA_ORACLE i05c09 : oracle : P97RPPRD ]> exp P97RPPRD/P97RPPRD tables=mytable log=test.log file=test.dmp
Export: Release 9.2.0.4.0 - Production on Tue Nov 14 13:41:39 2006
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
Connected to: Oracle9i Enterprise Edition Release 9.2.0.4.0 - 64bit Production
With the Partitioning option
JServer Release 9.2.0.4.0 - Production
Export done in UTF8 character set and AL16UTF16 NCHAR character set
About to export specified tables via Conventional Path ...
. . exporting table MYTABLE 7 rows exported
Export terminated successfully without warnings.
[data/ora/adm/DBA_ORACLE i05c09 : oracle : P97RPPRD ]> imp P97RPPRD/P97RPPRD tables=mytable log=test.log file=test.dmp ignore=y
Import: Release 9.2.0.4.0 - Production on Tue Nov 14 13:41:49 2006
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
Connected to: Oracle9i Enterprise Edition Release 9.2.0.4.0 - 64bit Production
With the Partitioning option
JServer Release 9.2.0.4.0 - Production
Export file created by EXPORT:V09.02.00 via conventional path
import done in UTF8 character set and AL16UTF16 NCHAR character set
. importing P97RPPRD's objects into P97RPPRD
. . importing table "MYTABLE"
IMP-00019: row rejected due to ORACLE error 1
IMP-00003: ORACLE error 1 encountered
ORA-00001: unique constraint (P97RPPRD.SYS_C001422815) violated
Column 1 SYS
Column 2 0
Column 3 14-NOV-2005:16:14:52
IMP-00019: row rejected due to ORACLE error 1
IMP-00003: ORACLE error 1 encountered
ORA-00001: unique constraint (P97RPPRD.SYS_C001422815) violated
Column 1 SYSTEM
Column 2 5
Column 3 14-NOV-2005:16:14:52
IMP-00019: row rejected due to ORACLE error 1
IMP-00003: ORACLE error 1 encountered
ORA-00001: unique constraint (P97RPPRD.SYS_C001422815) violated
Column 1 OUTLN
Column 2 11
Column 3 14-NOV-2005:16:15:05
IMP-00019: row rejected due to ORACLE error 1
IMP-00003: ORACLE error 1 encountered
ORA-00001: unique constraint (P97RPPRD.SYS_C001422815) violated
Column 1 DBSNMP
Column 2 19
Column 3 14-NOV-2005:16:24:23
IMP-00019: row rejected due to ORACLE error 1
IMP-00003: ORACLE error 1 encountered
ORA-00001: unique constraint (P97RPPRD.SYS_C001422815) violated
Column 1 PS
Column 2 21
Column 3 14-NOV-2005:16:36:41
IMP-00019: row rejected due to ORACLE error 1
IMP-00003: ORACLE error 1 encountered
ORA-00001: unique constraint (P97RPPRD.SYS_C001422815) violated
Column 1 P97RPPRD
Column 2 24
Column 3 14-NOV-2005:16:53:41
IMP-00019: row rejected due to ORACLE error 1
IMP-00003: ORACLE error 1 encountered
ORA-00001: unique constraint (P97RPPRD.SYS_C001422815) violated
Column 1 PEOPLE
Column 2 25
Column 3 14-NOV-2005:16:57:09 0 rows imported
Import terminated successfully with warnings.
[data/ora/adm/DBA_ORACLE i05c09 : oracle : P97RPPRD ]> HTH,
Nicolas. -
Deleting duplicate rows based on three columns in Oracle 8i
Hi all,
The database we use is Oracle 8i.
The query below raises the too_many_rows exception when I launch an application. So I want to delete the duplicated rows :
select polarisation_1, polarisation_2
into v_pol1_tech, v_pol2_tech
from v_cfh_lien_element
where nom_lien = p_nom_lien
AND num_canal_1 = p_num_canal_1
AND freq_emise_1 = p_freq_emise_1;
Notice that with many possible values of the parameters p_nom_lien, p_num_canal_1 and p_freq_emise_1 then the exception is raised.
So how to delete generally the duplicated rows based on the three columns "nom_lien" , "num_canal_1" and "freq_emise_1" ?
Thank you very much indeed.Check the other thread with same question deleting duplicate rows based on three columns in Oracle 8i
-
How to convert row data into columns without using pivot table?
Hello guys
I have a report that has several columns about sales call type and call counts
It looks like this:
Calls Type Call Counts
Missed 200
Handled 3000000
Rejected 40000
Dropped 50000
Now I wanna create a report that look like this:
Missed call counts Handled Call counts Rejected Counts Drop counts Other Columns
200 300000000 40000 50000 Data
So that I can perform other calculations on the difference and comparison of handled calls counts vs other call counts..
I know pivot table view can make the report look like in such way, but they cant do further calculations on that..
So I need to create new solid columns that capture call counts based on call types..
How would I be able to do that on Answers? I don't have access to the RPD, so is it possible to do it sololy on answers? Or should I just ask ETL support on this?
Any pointers will be deeply appreciated!
Thank youThanks MMA
I followed your guidance and I was able to create a few new columns of call missed count, call handled counts and call abandoned counts.. Then I create new columns of ave missed counts, ave handled counts and so forth..
Then I went to the pivot view, I realized there is a small problem.. Basically the report still includes the column "call types" which has 3 different types of call "miss, abandon and handled". When I exclude this column in my report, the rest of the measures will return wrong values. When I include this column in the report, it shows duplicate values by 3 rows. It looks like this:
Queue name Call types Call handled Call missed Call abondoned
A Miss 8 10 15
A Handled 8 10 15
A Abandoned 8 10 15
in pivot table view, if I move call type to column area, the resulted measures will become 8X3, 10X3 and 15X3
So is there a way to eliminate duplicate rows or let the system know not to mulitply by 3?
Or is this as far as presentation service can go in terms of this? Or should I advice to provide better data from the back end?
Please let me know, thanks -
Trying to omit duplicate rows in a UNION
I am trying to omit duplicate rows from my union’ed join of 2 tables but am running into a problem which I am hoping someone can help me with. The following SQL works, but doesn’t omit the dups.
SELECT service_code, description_txt, effective_date, ROW_NUMBER() OVER (PARTITION BY service_code
ORDER BY effective_date DESC) AS rn
FROM
(SELECT s.service_code, s.effective_date, s.description_txt
FROM state_code_desc s
WHERE s.expire_date IS NULL
AND s.code_type='H'
AND s.coverage_type='W'
AND s.geo_area_code='USA'
AND s.state_abbr='GE'
UNION
SELECT f.service_code, f.effective_date, f.description_txt
FROM fed_code_desc f
WHERE f.code_type='H'
AND f.expire_date IS NULL
ORDER BY service_code
When I try to add the WHERE RN=1 immediately before the ORDER by service_code (last line of the SQL), I get the following error:
ORA-00904 – “RN” Invalid identifier
Can someone out there help me out, please?
Thanks!
Janet
P.S.-I'm running Oracle 9.1Just a precesion,
It is not a question of analytic functions at all
In fact, column aliases are not usable in tbe same
query in the WHERE clause.
SQL> SELECT deptno,COUNT(*) OVER (PARTITION BY deptno) cnt
2 FROM emp;
DEPTNO CNT
10 2
10 2
20 2
20 2
30 5
30 5
30 5
30 5
30 5
9 rows selected.
SQL> SELECT deptno,COUNT(*) OVER (PARTITION BY deptno) cnt
2 FROM emp
3 WHERE cnt=1;
WHERE cnt=1
ERROR at line 3:
ORA-00904: "CNT": invalid identifier
SQL> SELECT deptno,sal*100 s,COUNT(*) OVER (PARTITION BY deptno) cnt
2 FROM emp
3 WHERE s=100;
WHERE s=100
ERROR at line 3:
ORA-00904: "S": invalid identifier
SQL> SELECT deptno,sal*100 s,COUNT(*) OVER (PARTITION BY deptno) cnt
2 FROM emp
3 WHERE (sal*100)=100;
no rows selected
SQL> SELECT deptno,sal*100 s,COUNT(*) OVER (PARTITION BY deptno) cnt
2 FROM emp
3 HAVING COUNT(*) OVER (PARTITION BY deptno)=2;
HAVING COUNT(*) OVER (PARTITION BY deptno)=2
ERROR at line 3:
ORA-30483: window functions are not allowed hereKhurram -
Duplicate rows on Query with journal entries and AP documents
Hi Experts,
I ahve the below query allowing me to have some information from journal entries and retrieve some other from AP docuements and PO.
The thing is the query duplicates rows because the AP docuements have several rows but i don t know how to do to remove them (i guess this has to do with JOIN function...)
SELECT
T2.[GroupMask] as 'Account Family',
T2.[FatherNum] as 'Parent Account',
T2.[AcctCode] AS 'Account Code',
T2.[AcctName] AS 'Account Name',
T0.[TaxDate] AS 'Document Date',
T0.[Number] AS 'Number',
T0.[DocSeries] AS 'Document Series',
T0.[BaseRef] AS 'Base Reference',
T0.[TransId] AS 'Transaction Number',
T0.[Ref2] AS 'Reference 2',
T1.[ContraAct] AS 'Offset Account',
T4.[BaseRef] AS 'PO code',
T1.[Project] AS 'Project Code',
T1.[ProfitCode] AS 'Distribution Rule',
T1.[OcrCode2] AS 'Costing Code 2',
T1.[OcrCode3] AS 'Costing Code 3',
T1.[OcrCode4] AS 'Costing Code 4',
(T1.[SYSdeb]-T1.[SYSCred]) AS 'Total Amount EUR',
(T1.[FCDebit]- T1.[FCCredit]) AS 'Total Amount (FC)',
T5.[DocTotalSy] AS 'PO Amount (EUR)'
FROM [dbo].[OJDT] T0
INNER JOIN [dbo].[JDT1] T1 ON T1.[TransId] = T0.[TransId]
INNER JOIN [dbo].[OACT] T2 ON T2.[AcctCode] = T1.[Account] AND T2.[AcctCode] = T1.[Account]
INNER JOIN [dbo].[OPCH] T3 ON T3.[DocNum] = T0.[BaseRef]
INNER JOIN [dbo].[PCH1] T4 ON T3.[DocEntry] = T4.[DocEntry]
LEFT JOIN [dbo].[OPOR] T5 ON T5.[DocNum] = T4.[BaseRef]
WHERE
(T2.[AcctCode] > (N'599999' ) ) AND (T2.[AcctCode] < (N'799999' ) )
AND (T0.[TaxDate]>= [%0] ) AND (T0.[TaxDate]<= [%1])Try This
SELECT T2.[GroupMask] AS 'Account Family',
T2.[FatherNum] AS 'Parent Account',
T2.[AcctCode] AS 'Account Code',
T2.[AcctName] AS 'Account Name',
T0.[TaxDate] AS 'Document Date',
T0.[Number] AS 'Number',
T0.[DocSeries] AS 'Document Series',
T0.[BaseRef] AS 'Base Reference',
T0.[TransId] AS 'Transaction Number',
T0.[Ref2] AS 'Reference 2',
T1.[ContraAct] AS 'Offset Account',
T4.[BaseRef] AS 'PO code',
T1.[Project] AS 'Project Code',
T1.[ProfitCode] AS 'Distribution Rule',
T1.[OcrCode2] AS 'Costing Code 2',
T1.[OcrCode3] AS 'Costing Code 3',
T1.[OcrCode4] AS 'Costing Code 4',
sum(T1.[SYSdeb]-T1.[SYSCred]) AS 'Total Amount EUR',
sum(T1.[FCDebit]- T1.[FCCredit]) AS 'Total Amount (FC)',
T6.[DocTotalSy] AS 'PO Amount (EUR)'
FROM OJDT T0
INNER JOIN JDT1 T1 ON T0.TransId = T1.TransId
INNER JOIN OACT T2 ON T1.Account = T2.AcctCode
INNER JOIN OPCH T3 ON T0.TransId = T3.TransId
INNER JOIN PCH1 T4 ON T3.DocEntry = T4.DocEntry
INNER JOIN POR1 T5 ON T4.[BaseEntry] = T5.[DocEntry]
AND T4.[BaseLine] = T5.[LineNum]
INNER JOIN OPOR T6 ON T5.DocEntry = T6.DocEntry
GROUP BY T2.[GroupMask],
T2.[FatherNum],
T2.[AcctCode],
T2.[AcctName],
T0.[TaxDate],
T0.[Number],
T0.[DocSeries],
T0.[BaseRef],
T0.[TransId],
T0.[Ref2],
T1.[ContraAct],
T4.[BaseRef],
T1.[Project],
T1.[ProfitCode],
T1.[OcrCode2],
T1.[OcrCode3],
T1.[OcrCode4],
T6.[DocTotalSy]
Regards,
Kennedy
Maybe you are looking for
-
Query plan and negative value in where
I have a question about this query: select g.col1, g.col2 from tab1 g, tab2 part where part.col3 <> 0 and g.col4 = 'PRO3' and g.col2 = part.col5 and g.cod7 = -1 This is the execution plan: SELECT STATEMENT, GOAL = ALL_ROWS HASH JOIN
-
I can pair but not connect my MacBook Pro to my iPhone 5cs
I have a mid-2005 MacBook Pro running Yosemite OS. I can pair my iPhone but cannot sustain a connection with it for more than a second or two.
-
How to print entire print component
I have an application with fixed height & width. I have a list component that displays additional content when an item is clicked. I want to be able to print the entire list with each item's additional text. I'm only getting a part of the data. I cre
-
Why does airplay to apple tv from iphone 6 go dark after playing video?
Both devices have the latest updates. While browsing using Safari on iphone, and airplay to apple tv active, I click on a video. The video plays but when completed the screen goes blank. I tried turning airplay off and on but nothing seems to work
-
Events that will or are likely to happen in the time to come
I talked my way in to a job(im a newcomer) hint ...im going to shoot footage of a race car.What the client has asked me to do is have an image of a person in the mirror. im reading the manual on shake. tracking ect...im looking for future input on th