Re: Row Count

From: Thomas Kellerer <spam_eater(at)gmx(dot)net>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: Row Count
Date: 2013-02-12 08:00:33
Message-ID: kfcspc$hqb$1@ger.gmane.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Sergey Gigoyan, 12.02.2013 08:05:
> How can I get selected row count in one statement?
> For example, I can do that by two select statements
>
> select id, name, addrress, (select count(*) from(select id
> from users
> where name<>'examplename')
> from users
> where name<>'examplename'
>

select id,
name,
addrress,
count(*) over () as row_count
from users
where name <> 'examplename';

In response to

  • Row Count at 2013-02-12 07:05:20 from Sergey Gigoyan

Browse pgsql-novice by date

  From Date Subject
Next Message Andreas Kretschmer 2013-02-12 08:03:02 Re: Row Count
Previous Message Sergey Gigoyan 2013-02-12 07:05:20 Row Count