Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Problems with CAST and order by

Problems with CAST and order by

From: Francesco S. Rinaldi <thechessPUSSAVIASPAMMERplayer_at_tin.it>
Date: Thu, 16 Jan 2003 16:58:48 +0100
Message-ID: <b06kuu$m1oud$1@ID-136664.news.dfncis.de>


I have this problem:
This query is working:
select distinct cast(history.object_id as varchar(14)), object_assembly.object, history.center from history, object_assembly where history.object_id like '30210314%' and history.object_id = object_assembly.object_id

But I need to order the results by object_id, and it's not working. If I try simply to add
order by object_id
I get the following error message:
DB: ERROR: ORA-00918 column ambiguosly defined The same error I get if I add
order by cast(object_id as varchar(14))
while if i try
order by history.object_id
I get
DB: ERROR: ORA-01791 not a SELECTed expression

How to solve this ?

Thanks in advance,
Francesco Received on Thu Jan 16 2003 - 09:58:48 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US