Re: cast

From: "Dan Feiveson" <danf(at)datajoe(dot)com>
To: "Judith Altamirano Figueroa" <jaltamirano(at)correolux(dot)com(dot)mx>, <pgsql-sql(at)postgresql(dot)org>
Subject: Re: cast
Date: 2005-10-14 18:20:07
Message-ID: 011a01c5d0eb$e7dfc120$fb04030a@CCPlanet.Com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

I believe int8(n.udf4) will do the trick for you.

----- Original Message -----
From: "Judith Altamirano Figueroa" <jaltamirano(at)correolux(dot)com(dot)mx>
To: <pgsql-sql(at)postgresql(dot)org>
Sent: Friday, October 14, 2005 12:08 PM
Subject: [SQL] cast

> Hello I have a query that ran in 7.0.2, but in 8.0.1 does not, the query
> is the next:
>
>
>
> select n.factura,
> n.venta_neta,
> c.nombre_cli || ' ' || c.apellido_pat_cli || ' ' || coalesce
> (c.apellido_mat_cli,''),
> date(n.fecha_hora_factura),
> o.nombre_oft
> from nota_venta n,
> clientes c,
> oft_central o
> where date(n.fecha_hora_factura) >= '2005-10-01' and
> date(n.fecha_hora_factura) <= '2005-10-14' and
> n.id_cliente = c.id_cliente and
> cast(n.udf4 as integer) = o.id_oft_central and
> n.factura is not null and
> n.s_factura != 'T'
> order by o.nombre_oft";
>
> it aparently returns an error because the cast, but I need to do the
> cast, does somebody knows how can I change the cast but with the same
> result, thnks!!!!
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/docs/faq

In response to

  • cast at 2005-10-14 18:08:43 from Judith Altamirano Figueroa

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2005-10-14 18:28:24 Re: FULL OUTER JOIN Question
Previous Message Andrew Sullivan 2005-10-14 18:19:03 Re: cast