Re: ORA-00933: SQL command not properly ended

From: Norman Dunbar <oracle_at_dunbar-it.co.uk>
Date: Fri, 04 Jan 2013 16:34:09 +0000
Message-ID: <50E70481.1090000_at_dunbar-it.co.uk>



Afternoon Jose,

On 04/01/13 16:07, Jose Soares wrote:
> Hi all,
>
> I have a query that succeed in postgres but it fails in oracle and I
> don't know why?

> select v.articolo,fs.descrizione as
> fontes,s.articolo,s.importo_min,s.importo_max from norma as s join norma
> as v on s.id = v.id_norma_sanzionatoria join fonte as fv on
> v.id_fonte=fv.id join fonte as fs on s.id_fonte=fs.id;

Removes the "as" when aliasing your table names. It is allowed when aliasing column names, but not tables.

You need something like:

select 	v.articolo,
	fs.descrizione as fontes,
	s.articolo,
	s.importo_min,
	s.importo_max
from 	norma s
join 	norma v on s.id = v.id_norma_sanzionatoria
join 	fonte fv on v.id_fonte = fv.id
join 	fonte fs on s.id_fonte = fs.id;


Cheers,
Norm.

-- 
Norman Dunbar
Dunbar IT Consultants Ltd

Registered address:
Thorpe House
61 Richardshaw Lane
Pudsey
West Yorkshire
United Kingdom
LS28 7EL

Company Number: 05132767
--
http://www.freelists.org/webpage/oracle-l
Received on Fri Jan 04 2013 - 17:34:09 CET

Original text of this message