Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Querying Distinct Users

Querying Distinct Users

Scheduled Pinned Locked Moved Database
databasequestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Skanless
    wrote on last edited by
    #1

    Hello, I am attempting to select all users who are visiting our site with multiple IPAdresses. I wrote the query below but it is not doing what I want it to do. Any assistance in accomplishing this task will be greatly appreciated. Select UserID from AU_commontable where UserID IN if exists(Select ipaddress as IP, count (ipaddress )as Total --, userID,logdate from AU_commontable where result=1 and actiontaken='firsttimesignon' group by ipaddress having (count(ipaddress)>1))

    Skan If you knew it would not compile why didn't you tell me?!?!?!

    M 1 Reply Last reply
    0
    • S Skanless

      Hello, I am attempting to select all users who are visiting our site with multiple IPAdresses. I wrote the query below but it is not doing what I want it to do. Any assistance in accomplishing this task will be greatly appreciated. Select UserID from AU_commontable where UserID IN if exists(Select ipaddress as IP, count (ipaddress )as Total --, userID,logdate from AU_commontable where result=1 and actiontaken='firsttimesignon' group by ipaddress having (count(ipaddress)>1))

      Skan If you knew it would not compile why didn't you tell me?!?!?!

      M Offline
      M Offline
      M H 1 2 3
      wrote on last edited by
      #2

      select userid,ipaddress, count(1) as[number of unique ipaddress] from AU_commontable where result=1 and actiontaken='firsttimesignon' group by userid,ipaddress having count(1)>1

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups