Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 711847
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T04:46:54+00:00 2026-05-14T04:46:54+00:00

I have an iPhone app out there that calls home to my server every

  • 0

I have an iPhone app out there that “calls home” to my server every time a user uses it. On my server, I create a row in a MySQL table each time with the unique ID (similar to a serial number) aka UDID for the device, IP address, and other data.

Table ClientLog columns:
Time, UDID, etc, etc.

What I’d like to know is the number of new devices (new unique UDIDs) on a given date. I.e. how many UDIDs were added to the table on a given date that don’t appear before that date? Put plainly, this is the number of new users I gained that day.

This is close, I think, but I’m not 100% there and not sure it’s what I want…

SELECT distinct UDID
FROM ClientLog a
WHERE NOT EXISTS (
    SELECT * 
    FROM ClientLog b 
    WHERE a.UDID = b.UDID AND b.Time <= '2010-04-05 00:00:00'
)

I think the number of rows returned is the new unique users after the given date, but I’m not sure. And I want to add to the statement to limit it to a date range (specify an upper bound as well).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T04:46:55+00:00Added an answer on May 14, 2026 at 4:46 am

    Your query seems correct, and you can add bounds like this:

    SELECT DISTINCT UDID FROM ClientLog a WHERE a.Time >= '2010-04-05 00:00:00'
                                            AND a.Time <  '2010-04-06 00:00:00'
    
    AND NOT EXISTS(SELECT * FROM ClientLog b WHERE a.UDID = b.UDID
                                               AND b.Time < '2010-04-05 00:00:00');
    

    UPDATE: another method that comes to mind is below, but I believe it’s slower:

    SELECT DISTINCT UDID FROM ClientLog a WHERE a.Time >= '2010-04-05 00:00:00'
                                            AND a.Time <  '2010-04-06 00:00:00'
                                            AND a.UDID <> ALL
    (SELECT DISTINCT udid FROM ClientLog b where b.Time < '2010-04-05 00:00:00');
    

    UPDATE 2: Of course, if you’re only interested in the number of new UDIDs, then this would be the best solution:

    SELECT COUNT(DISTINCT UDID) FROM ClientLog WHERE Time < '2010-04-05 00:00:00';
    SELECT COUNT(DISTINCT UDID) FROM ClientLog WHERE Time < '2010-04-06 00:00:00';
    

    Then take the difference in your code (there might be a way to do it in MySQL, but I’m not a MySQL expert).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an IPhone app that uses webservices to get data from a server.
I have an iPhone app that uses HessianKit to talk to my java server.
I have my iPhone app that calls an ASP.NET Webservice to download data. Most
I have an iPhone app out that stores data on the device. I want
I have an Iphone app that uses alot of int values that will increment
I have figured out how to add a custom calendar within my iPhone app,
I have an iPhone app that I've built for the app store. Before I
I have an iPhone app that I am writing and it has 2 targets
I have an iPhone app that allows users to record videos and I'd like
I have an iphone app i want that befor moving to next screen it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.