Re: Postgres and alias

2020-08-28 Thread Laurenz Albe
On Thu, 2020-08-27 at 12:55 -0300, Fontana Daniel C (Desartec S.R.L.) wrote: > Hi, I am migrating a database from Sybase to PostgreSql 12. > > This select in sybase works for me, but with postgresql it accuses me > "THERE IS NO COLUMN ls_numero" > > select '1234567890' as ls_number, >

Re: Postgres and alias

2020-08-28 Thread Stelios Sfakianakis
o el: jueves, 27 de agosto de 2020 12:59 > Para: Fontana Daniel C (Desartec S.R.L.) > CC: pgsql-general@lists.postgresql.org > Asunto: Re: Postgres and alias > > Hmm, how about: > > SELECT substr (ls_number, 3, 3) > FROM (VALUES('1234567890')) as t(ls_number); &g

Re: Postgres and alias

2020-08-28 Thread Alban Hertroys
> On 28 Aug 2020, at 2:14, Fontana Daniel C (Desartec S.R.L.) > wrote: > > Perfect. > > now let's imagine that '1234567890' is a function f_art_get_price(id_code), > which returns in a string like the following 'XXXZMMM1234567890123/mm/dd' > where 1234567890123 is the price and /mm/d

Postgres and alias

2020-08-27 Thread Fontana Daniel C (Desartec S.R.L.)
original- De: Stelios Sfakianakis [mailto:sgs...@gmail.com] Enviado el: jueves, 27 de agosto de 2020 12:59 Para: Fontana Daniel C (Desartec S.R.L.) CC: pgsql-general@lists.postgresql.org Asunto: Re: Postgres and alias Hmm, how about: SELECT substr (ls_number, 3, 3) FROM (VALUES('1234567890

Re: Postgres and alias

2020-08-27 Thread Paul Förster
Hi Daniel, > On 27. Aug, 2020, at 17:55, Fontana Daniel C (Desartec S.R.L.) > wrote: > > Hi, I am migrating a database from Sybase to PostgreSql 12. > > This select in sybase works for me, but with postgresql it accuses me > "THERE IS NO COLUMN ls_numero" > > select '1234567890' as ls_number,

Re: Postgres and alias

2020-08-27 Thread Stelios Sfakianakis
Hmm, how about: SELECT substr (ls_number, 3, 3) FROM (VALUES('1234567890')) as t(ls_number); St. > On 27 Aug 2020, at 18:55, Fontana Daniel C (Desartec S.R.L.) > wrote: > > Hi, I am migrating a database from Sybase to PostgreSql 12. > > This select in sybase works for me, but with postgresql

Postgres and alias

2020-08-27 Thread Fontana Daniel C (Desartec S.R.L.)
Hi, I am migrating a database from Sybase to PostgreSql 12. This select in sybase works for me, but with postgresql it accuses me "THERE IS NO COLUMN ls_numero" select '1234567890' as ls_number, substr (ls_number, 3, 3); Is it possible to get information from an alias in postg