Staggan Posted August 28, 2014 Share Posted August 28, 2014 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 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? 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... 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 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 ... 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. 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
Archived
This topic is now archived and is closed to further replies.