Re: SINTAX ERROR!! - Mailing list pgsql-jdbc

From Nick Fankhauser
Subject Re: SINTAX ERROR!!
Date
Msg-id NEBBLAAHGLEEPCGOBHDGKEHCENAA.nickf@ontko.com
Whole thread Raw
In response to SINTAX ERROR!!  ("Gonzalo A. Aranda Corral" <garanda@bitakora.com>)
List 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@ontko.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@postgresql.org
> [mailto:pgsql-jdbc-owner@postgresql.org]On Behalf Of Gonzalo A. Aranda
> Corral
> Sent: Wednesday, April 24, 2002 6:46 AM
> To: pgsql-jdbc@postgresql.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
>


pgsql-jdbc by date:

Previous
From: "Gonzalo A. Aranda Corral"
Date:
Subject: SINTAX ERROR!!
Next
From: João Paulo Ribeiro
Date:
Subject: Re: SINTAX ERROR!!