All pastes #146719 Raw Edit

Stuff

public text v1 · immutable
#146719 ·published 2006-08-23 20:34 UTC
rendered paste body
I have 2 tables, A, and B.  In A, there is an ID column along with several others.  In B, there are rows which refer to the ID column in A with a 1 to many relationship.I want to be able to select 1 row of data from A along with the count of rows in B that refer to the ID in that row from A.This was my first attempt, but I am getting 00937: not a single-group group function:select A.ID, A.COLUMN1, A.COLUMN2, count(B.ID)from A, Bwhere A.ID (+)= B.REFERS_TO_A;