Re: How to write such a query?

Поиск
Список
Период
Сортировка
От Igor Korot
Тема Re: How to write such a query?
Дата
Msg-id CA+FnnTwJFdp20d7mFGjWHKP4NzLNMAqya7_zhMSJdUWuX=MOVw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: How to write such a query?  (Amul Sul <sulamul@gmail.com>)
Список pgsql-general
Hi, Armul,

On Thu, Jan 6, 2022 at 12:46 AM Amul Sul <sulamul@gmail.com> wrote:
>
> See prepare statement : https://www.postgresql.org/docs/current/sql-prepare.html

The documentation is talking about a way to do it like:

SELECT a, b, c FROM foo WHERE id = $1,

which is equivalent to the

SELECT a, b, c FROM foo WHERE id = ?;

i.e. using unnamed parameter.

Thank you.

>
> On Thu, Jan 6, 2022 at 12:10 PM Igor Korot <ikorot01@gmail.com> wrote:
> >
> > Hi, ALL,
> > In SQLite you can write:
> >
> > SELECT a, b, c FROM foo WHERE id = :id;
> >
> > where ":id" is the named parameter.
> >
> > The query above is similar to
> >
> > SELECT a,b,c FROM foo WHERE id = ?;
> >
> > except that the parameter has a name.
> >
> > Is there a way to write such a SELECT statement with the
> > named parameter in PostgreSQL?
> >
> > Thank you.
> >
> >



В списке pgsql-general по дате отправления:

Предыдущее
От: Ron
Дата:
Сообщение: Re: How to write such a query?
Следующее
От: Ron
Дата:
Сообщение: Re: How to write such a query?