duplicat alias in query, but the same time none duplicats.. [message #461039] |
Wed, 16 June 2010 04:13 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
Fredr1k
Messages: 15 Registered: June 2010 Location: Vardø, Norway
|
Junior Member |
|
|
Hi. Im having a problem with a query.
I made a report region with this query:
select kat.ID, prod.NAVN, prod.ID, prod.PRIS, prod.SYNLIGHET, prod.KATAGORI_ID
from LM_KATAGORI kat, LM_VARER prod
where prod.SYNLIGHET = 1 and
kat.ID = prod.KATAGORI_ID
And i got an error telling me it was duplicat Alias the query.
Then i went to SQL workshop, and tried the code. And there it worked...
|
|
|
|
Re: duplicat alias in query, but the same time none duplicats.. [message #461141 is a reply to message #461044] |
Wed, 16 June 2010 13:21 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](/forum/images/custom_avatars/72104.gif) |
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
This is Apex, I presume. Which version do you use? I tried a similar example in 3.2.1 and it works OK. Is your version lower than that?
select kat.ID, prod.NAVN, prod.ID, prod.PRIS, prod.SYNLIGHET, prod.KATAGORI_ID
The only "duplicates" I see are red & blue - both columns are "ID". Try to create column aliases as well; something like
select kat.id id_kat, prod.id id_prod, ...
If it still doesn't work, please, provide some more details.
I'll move a topic to Apex forum. If it, however, doesn't belong there, report this message to a moderator and explain where you'd want it to be.
|
|
|
|
|
|
Re: duplicat alias in query, but the same time none duplicats.. [message #461303 is a reply to message #461039] |
Thu, 17 June 2010 05:57 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
Fredr1k
Messages: 15 Registered: June 2010 Location: Vardø, Norway
|
Junior Member |
|
|
hmm. Now the duplicat error was shown again ![Neutral](images/smiley_icons/icon_neutral.gif)
select prod.NAVN, prod.ID vare_id, prod.PRIS, prod.SYNLIGHET, prod.KATAGORI_ID, kat.ID kat_id, kat.NAVN
from LM_KATAGORI kat, LM_VARER prod
where prod.SYNLIGHET = 1 and
kat.ID = prod.KATAGORI_ID
order by prod.ID DESC
I can't see any duplicat.
Here's the complete error message:
ORA-20001: Your query contains duplicate alias names, queries used for reports require unique alias names.
|
|
|
|
|
|
|