On Friday 07 Feb 2003 1:26 pm, Tomasz Myrta wrote: > Gary Stainburn wrote: > > On Friday 07 Feb 2003 10:48 am, Tomasz Myrta wrote: > > <cut> > > > Hi Tomasz, > > [snip] > > I understood your problem well and I just thought some idea will be enough > to continue work. > > Here is detailed query for your problem: > > create view some_view as > select > coalesce(hjid,rjid) as jid, > coalesce(hsid,rsid) as sid, > coalesce(hcount,1)+count(*)-1 as hcount > from > history > full outer join roster on (hjid=rjid and hsid=rosid) > group by hjid,rjid,hsid,rosid; > > Regards, > Tomasz Myrta
Many appologoes Tomasz. Because your select *LOOKED* wrong to me, I didn't even try it. Upon looking at it again I can see what you're doing. When I tried, it complained about the counts and grouping, so I moved the count(*) to a sub-select and changed the coalesce and it's working. Thanks, Gary > > > > ---------------------------(end of broadcast)--------------------------- > TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED] -- Gary Stainburn This email does not contain private or confidential material as it may be snooped on by interested government parties for unknown and undisclosed purposes - Regulation of Investigatory Powers Act, 2000 ---------------------------(end of broadcast)--------------------------- TIP 6: Have you searched our list archives? http://archives.postgresql.org