Staggan Posted August 28, 2014 Share Posted August 28, 2014 (edited) 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 August 28, 2014 by Staggan Quote Link to comment https://forums.phpfreaks.com/topic/290697-multiple-query-on-same-table/ Share on other sites More sharing options...
Barand Posted August 28, 2014 Share Posted August 28, 2014 Do you log a second record for the IP when installation completed or do you update the original record? Quote Link to comment https://forums.phpfreaks.com/topic/290697-multiple-query-on-same-table/#findComment-1489128 Share on other sites More sharing options...
Staggan Posted August 28, 2014 Author Share Posted August 28, 2014 We log a second record... Quote Link to comment https://forums.phpfreaks.com/topic/290697-multiple-query-on-same-table/#findComment-1489129 Share on other sites More sharing options...
Barand Posted August 28, 2014 Share Posted August 28, 2014 (edited) 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 August 28, 2014 by Barand Quote Link to comment https://forums.phpfreaks.com/topic/290697-multiple-query-on-same-table/#findComment-1489130 Share on other sites More sharing options...
Staggan Posted August 28, 2014 Author Share Posted August 28, 2014 Thank you for the quick replies and help.... works fine. Quote Link to comment https://forums.phpfreaks.com/topic/290697-multiple-query-on-same-table/#findComment-1489131 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.