DISTINCT in XMLQuery ?? [message #278604] |
Mon, 05 November 2007 02:38 |
panzertape
Messages: 20 Registered: August 2007
|
Junior Member |
|
|
Hi !
I have a problem with duplicate values. So I thought I could get rid of them by using DISTINCT. But I don't know where to place it
Thats my Statement:
select XMLElement
("Table1",
XMLElement
("Table1_ITEM", XMLForest(--elements--) )
,
XMLElement
("Table2",
XMLAgg ( XMLElement
( "Table2_ITEM", XMLForest(--elements--) )
)
,
XMLElement
("Table3",
XMLAgg
(XMLElement
("Table3_ITEM", XMLForest(--elements--) )
)
)
))).getClobVal() AS XML
FROM Table1, Table2, Table3
WHERE Table1.ID = Table2.ID AND Table2.ID = Table3.ID
AND Table1.ID = 9439
GROUP BY --table1 elements--
The Statement works fine but I'm getting duplicate values
So do you have any ideas that could help to solve my problem??
Any help would be appreciated
thanks
panzertape
|
|
|
|
Re: DISTINCT in XMLQuery ?? [message #278609 is a reply to message #278604] |
Mon, 05 November 2007 02:45 |
panzertape
Messages: 20 Registered: August 2007
|
Junior Member |
|
|
When I do it this way (just SELECT DISTINCT XMLElement.......), then I'm getting an
ORA-22950: cannot ORDER objects without MAP or ORDER method-error.
Do you know how I can solve this error?
|
|
|
|
|
|
Re: DISTINCT in XMLQuery ?? [message #290830 is a reply to message #278745] |
Tue, 01 January 2008 04:57 |
hrishy
Messages: 25 Registered: August 2005
|
Junior Member |
|
|
Hi
How about
FROM table1,
(SELECT id,sum(columns) * from table2
GROUP BY id) ab,
(select id,sum(columns) from table3
GROUP BY id) a
WHERE table1.ID = 9439
AND table1.ID = ab.ID
AND table1.ID = a.ID
|
|
|