select custid, count(vendid) as c415 from cv where vendid = 415 group by custid[...] Is there a better way (by creating an aggregate function, perhaps)
pgsql-general by date:
Соглашаюсь с условиями обработки персональных данных