Re: SINTAX ERROR!!

From: "Nick Fankhauser" <nickf(at)ontko(dot)com>
To: "Gonzalo A(dot) Aranda Corral" <garanda(at)bitakora(dot)com>, <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: SINTAX ERROR!!
Date: 2002-04-24 12:07:15
Message-ID: NEBBLAAHGLEEPCGOBHDGKEHCENAA.nickf@ontko.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

This question should be posted on the pgsql-sql list, but I'll give it a
shot.

The problem is that you are not specifying a table after the FROM. If you
are just after a distinct count of cdusuario FROM visitas, this should work:

select count(distinct cdusuario) as Cuenta from visitas;

-Nick
--------------------------------------------------------------------------
Nick Fankhauser nickf(at)ontko(dot)com Phone 1.765.935.4283 Fax 1.765.962.9788
Ray Ontko & Co. Software Consulting Services http://www.ontko.com/

> -----Original Message-----
> From: pgsql-jdbc-owner(at)postgresql(dot)org
> [mailto:pgsql-jdbc-owner(at)postgresql(dot)org]On Behalf Of Gonzalo A. Aranda
> Corral
> Sent: Wednesday, April 24, 2002 6:46 AM
> To: pgsql-jdbc(at)postgresql(dot)org
> Subject: [JDBC] SINTAX ERROR!!
>
>
>
>
> Someone of you can see where the sentence is wrong???
>
> SELECT Count(*) FROM (SELECT DISTINCT cdusuario FROM visitas) AS Cuenta;
>
> ...
> parse error near select!!!
>
>
> :(
>
> Thanks for your help!!
>
> gum.
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com)
> Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/02
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html
>

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message João Paulo Ribeiro 2002-04-24 13:22:39 Re: SINTAX ERROR!!
Previous Message Gonzalo A. Aranda Corral 2002-04-24 11:46:06 SINTAX ERROR!!