HELP! Left, Right, Inner Join

Discussion in 'ASP General' started by Jeff Uchtman, Apr 7, 2004.

  1. Jeff Uchtman

    Jeff Uchtman Guest

    I have a table that upon verify is inserting a unique Cir_ID in to one of
    four columns, PetACirc, PetBCirc, PetCCirc, PetDCirc. I am attempting to
    count the total number of columns each Cir_ID has filled and left join the
    name for association. I have part of it but can't get over the hump to get
    the count from the other 3 columns. Her is what I have:

    Select p.Cir_ID, p.First_Name, p.Last_Name,
    Count(c.PetACirc)AS [ACount],
    Count(c.PetBCirc)AS [BCount],
    Count(c.PetCCirc)AS [CCount],
    Count(c.PetDCirc)AS [DCount]
    From CirID
    AS p Left JOIN Verified as c on p.Cir_ID = c.PetACirc
    Group by p.Cir_ID, p.First_Name, p.Last_Name
    Order by p.Cir_ID

    As you can see it will give me the count on the PetACirc column in the line:

    AS p Left JOIN Verified as c on p.Cir_ID = c.PetACirc

    but I would also like PetBCirc, PetCCirc, and PetDCirc counts. Any help on
    inner and or left join with a distinct value?

    Thanks
    Jeff
     
    Jeff Uchtman, Apr 7, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Carlo v. Dango
    Replies:
    14
    Views:
    1,039
    Alex Martelli
    Oct 19, 2003
  2. =?Utf-8?B?QmlzaG95?=
    Replies:
    0
    Views:
    993
    =?Utf-8?B?QmlzaG95?=
    Dec 28, 2006
  3. Pyenos
    Replies:
    2
    Views:
    389
    Pyenos
    Dec 27, 2006
  4. =?iso-8859-1?q?Jean-Fran=E7ois_Michaud?=

    Help on table align on left of page vs left hanging indent

    =?iso-8859-1?q?Jean-Fran=E7ois_Michaud?=, Jul 10, 2007, in forum: XML
    Replies:
    2
    Views:
    1,008
    =?iso-8859-1?q?Jean-Fran=E7ois_Michaud?=
    Jul 16, 2007
  5. Oran
    Replies:
    2
    Views:
    544
Loading...

Share This Page