Re: getting the number of rows affected by a query

Поиск
Список
Период
Сортировка
От Sam Mason
Тема Re: getting the number of rows affected by a query
Дата
Msg-id 20071116125621.GU1955@frubble.xen.chris-lamb.co.uk
обсуждение исходный текст
Ответ на Re: getting the number of rows affected by a query  (Raymond O'Donnell <rod@iol.ie>)
Ответы Re: getting the number of rows affected by a query  ("Pavel Stehule" <pavel.stehule@gmail.com>)
Список pgsql-general
On Fri, Nov 16, 2007 at 12:51:07PM +0000, Raymond O'Donnell wrote:
> On 16/11/2007 10:02, Sam Mason wrote:
>
> >  SELECT COUNT(*) FROM (
> >    DELETE FROM foo RETURNING 1) x;
>
> I haven't played with this yet, but AFAICS this will simply return the
> integer value "1".

I currently get a syntax error, hence the way I wrote my message.

I'd not expect it to return 1 though.  The "1" is there simply to be
easy to evaluate, maybe "*" would have been better.  This 1 would get
returned to the outer query, which would end up counting the number of
rows deleted.


  Sam

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

Предыдущее
От: Raymond O'Donnell
Дата:
Сообщение: Re: getting the number of rows affected by a query
Следующее
От: "pobox@verysmall.org"
Дата:
Сообщение: unexplainable error