Jump to content

Multiple query on same table


Staggan

Recommended Posts

Hello

 

We have a database table that confirms the installations started and completed for our game... and I am looking to confirm how many installs start but never complete...

 

So, this is my current query...

SELECT description, ip from error_log where description like '%install%' order by ip;
 
 
description can be either install started or install completed and we use the IP to identify a specific user... 
 
 
How do I query that shows the IP's which have a started but no completed in the description ?
 
Any help would be appreciated
 
Thanks
Edited by Staggan
Link to comment
Share on other sites

in that case

SELECT inst.ip
FROM 
    (
    SELECT ip 
        FROM error_log WHERE description = 'install' 
    ) inst
    LEFT JOIN
        (
        SELECT ip 
        FROM error_log WHERE description = 'install completed'
        ) comp
    USING (ip)
WHERE comp.ip IS NULL
ORDER BY ip

edit : Should be "SELECT inst.ip ...

Edited by Barand
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.