perhaps this will get you started?
SELECT NAME, id2, COUNT(id1) OVER (PARTITION BY id2)
FROM invite
NAME ID2 COUNT(ID1)OVER(PARTITIONBYID2)
bob 1 2
helen 1 2
Jim 2 1
andy 181 1
On Thu, 16 Sep 2004 17:47:15 +0100, Andy J <[EMAIL PROTECTED]> wrote:
> I've got a SQL query which for love or money i cant seem to get my head around.
> The table:
>
> id2 name id1
> --------------------------------------
> 1 andy 181
> 2 bob 1
> 3 Jim 2
> 4 helen 1
>
> To explain what you are looking at a user with the ID 181 invited "Andy"
> Andy with the ID 1 invited bob and helen
> And Bob with the ID 2 invited jim.
>
> Hopefully you can see the setup.
>
> What i basically need to do is get a list of ID2 and a count of the
> people ID1 invited.
>
> Cheers
>
> Andy
>
>
[Todays Threads]
[This Message]
[Subscription]
[Fast Unsubscribe]
[User Settings]
[Donations and Support]
- SQL, count Andy J
- Re: SQL, count Greg Morphis
- Re: SQL, count Joe Rinehart
- Re: SQL, count Jeff Langevin
- Re: SQL, count Jeff Langevin
- Re: SQL, count Jeff Langevin
- Re: SQL, count Andy J
- RE: SQL, count Cornillon, Matthieu (Consultant)