Home » Developer & Programmer » Application Express, ORDS & MOD_PLSQL » duplicat alias in query, but the same time none duplicats.. (10g, APEX 3.2.1, Microsoft erver 2008)
duplicat alias in query, but the same time none duplicats.. [message #461039] Wed, 16 June 2010 04:13 Go to next message
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 #461044 is a reply to message #461039] Wed, 16 June 2010 04:28 Go to previous messageGo to next message
cookiemonster
Messages: 13894
Registered: September 2008
Location: Rainy Manchester
Senior Member
What tool did you get the error from and what is the exact error message - copy and paste please.
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 messageGo to next message
Littlefoot
Messages: 21562
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 #461144 is a reply to message #461141] Wed, 16 June 2010 13:36 Go to previous messageGo to next message
Fredr1k
Messages: 15
Registered: June 2010
Location: Vardø, Norway
Junior Member

Thanks Very Happy
Re: duplicat alias in query, but the same time none duplicats.. [message #461147 is a reply to message #461144] Wed, 16 June 2010 14:08 Go to previous messageGo to next message
Littlefoot
Messages: 21562
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
What does it mean? Is it OK now?
Re: duplicat alias in query, but the same time none duplicats.. [message #461243 is a reply to message #461147] Thu, 17 June 2010 04:32 Go to previous messageGo to next message
delna.sexy
Messages: 941
Registered: December 2008
Location: Surat, The Diamond City
Senior Member
/forum/fa/449/0/
Once upon a time, I was also facing the same problem, more than one column in report having same column name.
Just gave different aliases to them and done.

regards,
Delna
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 messageGo to next message
Fredr1k
Messages: 15
Registered: June 2010
Location: Vardø, Norway
Junior Member

hmm. Now the duplicat error was shown again Neutral

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.
Re: duplicat alias in query, but the same time none duplicats.. [message #461320 is a reply to message #461303] Thu, 17 June 2010 06:44 Go to previous messageGo to next message
Littlefoot
Messages: 21562
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
The same goes for the NAVN column.
Re: duplicat alias in query, but the same time none duplicats.. [message #461356 is a reply to message #461039] Thu, 17 June 2010 08:54 Go to previous messageGo to next message
Fredr1k
Messages: 15
Registered: June 2010
Location: Vardø, Norway
Junior Member

ohh, silly me :L
Re: duplicat alias in query, but the same time none duplicats.. [message #461408 is a reply to message #461356] Thu, 17 June 2010 14:16 Go to previous messageGo to next message
Littlefoot
Messages: 21562
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Welcome to the club Smile
Re: duplicat alias in query, but the same time none duplicats.. [message #461414 is a reply to message #461408] Thu, 17 June 2010 15:07 Go to previous message
Fredr1k
Messages: 15
Registered: June 2010
Location: Vardø, Norway
Junior Member

hehe, thanks Smile
Previous Topic: number error in apex during uploading csv file to table
Next Topic: How to compute "a * b = c"?
Goto Forum:
  


Current Time: Tue Jun 02 00:54:17 CDT 2020