how to display count values in join

  • hi i wrote query like this..

    select COUNT(u.userid) from users u inner join

    status s on

    (u.userid=s.mtid) or (u.userid=s.editorid)

    please find attchment..

    my query displaying count =3(here duplicates diplaying)

    but i need result only count=2(101,102 without duplicates..)

  • Pretty simple:

    select COUNT(DISTINCT u.userid) from users u inner join

    status s on

    (u.userid=s.mtid) or (u.userid=s.editorid)

  • thanks for helping ...it is working....

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply