nikas455 Posted April 7, 2014 Report Share Posted April 7, 2014 in sql remove all vehicles which are without action Link to comment Share on other sites More sharing options...
Guest Posted April 7, 2014 Report Share Posted April 7, 2014 Hi, I hope "without action" means, unused vehicles. You could use a query like this: SELECT * FROM `Object_DATA` WHERE `Object_DATA`.`Classname` NOT LIKE 'Tent%' AND `Object_DATA`.`Classname` NOT LIKE '%Locked' AND `Object_DATA`.`Classname` NOT LIKE 'Land%' AND `Object_DATA`.`Classname` NOT LIKE 'Cinder%' AND `Object_DATA`.`Classname` NOT LIKE 'Wood%' AND `Object_DATA`.`Classname` NOT LIKE 'Metal%' AND `Object_DATA`.`Classname` NOT LIKE '%Storage%' AND `Object_DATA`.`Classname` NOT IN ('OutHouse_DZ', 'GunRack_DZ', 'WorkBench_DZ', 'Sandbag1_DZ', 'FireBarrel_DZ', 'DesertCamoNet_DZ', 'StickFence_DZ', 'LightPole_DZ', 'DeerStand_DZ', 'ForestLargeCamoNet_DZ', 'Plastic_Pole_EP1_DZ', 'Hedgehog_DZ', 'FuelPump_DZ', 'Fort_RazorWire', 'SandNest_DZ', 'ForestCamoNet_DZ', 'Fence_corrugated_DZ', 'CanvasHut_DZ', 'Generator_DZ') AND `Object_DATA`.`LastUpdated` < NOW() - INTERVAL 7 DAY; To show vehicles which are unused since 7 days. Then use DELETE FROM `Object_DATA` WHERE `Object_DATA`.`Classname` NOT LIKE 'Tent%' AND `Object_DATA`.`Classname` NOT LIKE '%Locked' AND `Object_DATA`.`Classname` NOT LIKE 'Land%' AND `Object_DATA`.`Classname` NOT LIKE 'Cinder%' AND `Object_DATA`.`Classname` NOT LIKE 'Wood%' AND `Object_DATA`.`Classname` NOT LIKE 'Metal%' AND `Object_DATA`.`Classname` NOT LIKE '%Storage%' AND `Object_DATA`.`Classname` NOT IN ('OutHouse_DZ', 'GunRack_DZ', 'WorkBench_DZ', 'Sandbag1_DZ', 'FireBarrel_DZ', 'DesertCamoNet_DZ', 'StickFence_DZ', 'LightPole_DZ', 'DeerStand_DZ', 'ForestLargeCamoNet_DZ', 'Plastic_Pole_EP1_DZ', 'Hedgehog_DZ', 'FuelPump_DZ', 'Fort_RazorWire', 'SandNest_DZ', 'ForestCamoNet_DZ', 'Fence_corrugated_DZ', 'CanvasHut_DZ', 'Generator_DZ') AND `Object_DATA`.`LastUpdated` < NOW() - INTERVAL 7 DAY; To delete them. Cheers Exo Link to comment Share on other sites More sharing options...
nikas455 Posted April 7, 2014 Author Report Share Posted April 7, 2014 Hi, I hope "without action" means, unused vehicles. You could use a query like this: SELECT * FROM `Object_DATA` WHERE `Object_DATA`.`Classname` NOT LIKE 'Tent%' AND `Object_DATA`.`Classname` NOT LIKE '%Locked' AND `Object_DATA`.`Classname` NOT LIKE 'Land%' AND `Object_DATA`.`Classname` NOT LIKE 'Cinder%' AND `Object_DATA`.`Classname` NOT LIKE 'Wood%' AND `Object_DATA`.`Classname` NOT LIKE 'Metal%' AND `Object_DATA`.`Classname` NOT LIKE '%Storage%' AND `Object_DATA`.`Classname` NOT IN ('OutHouse_DZ', 'GunRack_DZ', 'WorkBench_DZ', 'Sandbag1_DZ', 'FireBarrel_DZ', 'DesertCamoNet_DZ', 'StickFence_DZ', 'LightPole_DZ', 'DeerStand_DZ', 'ForestLargeCamoNet_DZ', 'Plastic_Pole_EP1_DZ', 'Hedgehog_DZ', 'FuelPump_DZ', 'Fort_RazorWire', 'SandNest_DZ', 'ForestCamoNet_DZ', 'Fence_corrugated_DZ', 'CanvasHut_DZ', 'Generator_DZ') AND `Object_DATA`.`LastUpdated` < NOW() - INTERVAL 7 DAY; To show vehicles which are unused since 7 days. Then use DELETE FROM `Object_DATA` WHERE `Object_DATA`.`Classname` NOT LIKE 'Tent%' AND `Object_DATA`.`Classname` NOT LIKE '%Locked' AND `Object_DATA`.`Classname` NOT LIKE 'Land%' AND `Object_DATA`.`Classname` NOT LIKE 'Cinder%' AND `Object_DATA`.`Classname` NOT LIKE 'Wood%' AND `Object_DATA`.`Classname` NOT LIKE 'Metal%' AND `Object_DATA`.`Classname` NOT LIKE '%Storage%' AND `Object_DATA`.`Classname` NOT IN ('OutHouse_DZ', 'GunRack_DZ', 'WorkBench_DZ', 'Sandbag1_DZ', 'FireBarrel_DZ', 'DesertCamoNet_DZ', 'StickFence_DZ', 'LightPole_DZ', 'DeerStand_DZ', 'ForestLargeCamoNet_DZ', 'Plastic_Pole_EP1_DZ', 'Hedgehog_DZ', 'FuelPump_DZ', 'Fort_RazorWire', 'SandNest_DZ', 'ForestCamoNet_DZ', 'Fence_corrugated_DZ', 'CanvasHut_DZ', 'Generator_DZ') AND `Object_DATA`.`LastUpdated` < NOW() - INTERVAL 7 DAY; To delete them. Cheers Exo but only to remove vehicles like this? SELECT * FROM `Object_DATA` WHERE `Object_DATA`.`Classname` NOT LIKE 'Locked%' AND `Object_DATA`.`LastUpdated` < NOW() - INTERVAL 7 DAY; Link to comment Share on other sites More sharing options...
Guest Posted April 7, 2014 Report Share Posted April 7, 2014 but only to remove vehicles like this? SELECT * FROM `Object_DATA` WHERE `Object_DATA`.`Classname` NOT LIKE 'Locked%' AND `Object_DATA`.`LastUpdated` < NOW() - INTERVAL 7 DAY; I still don´t know what you are trying to do.... Can you give me some details about what you want to do. EDIT: If you only want not lockable vehicles to be deleted, than yes. You should at that line. Link to comment Share on other sites More sharing options...
cen Posted April 7, 2014 Report Share Posted April 7, 2014 You missed a few classnames ExoOnee BagFenceRound_DZ Scaffolding_DZ Link to comment Share on other sites More sharing options...
Guest Posted April 8, 2014 Report Share Posted April 8, 2014 I still don´t know what you are trying to do.... Can you give me some details about what you want to do. EDIT: If you only want not lockable vehicles to be deleted, than yes. You should at that line. *PUSH* Thanks :) Link to comment Share on other sites More sharing options...
Asian Kid Posted April 9, 2014 Report Share Posted April 9, 2014 How can I remove unused vehicles that are not locked delete every week I want to keep locked vehicles and bases just delete unused vehicles. Link to comment Share on other sites More sharing options...
Guest Posted April 9, 2014 Report Share Posted April 9, 2014 How can I remove unused vehicles that are not locked delete every week I want to keep locked vehicles and bases just delete unused vehicles. Try the query above. Add the BagFenceRound_DZ Scaffolding_DZ from cen. Then make a task to execute this query every week. Done :) Link to comment Share on other sites More sharing options...
Asian Kid Posted April 9, 2014 Report Share Posted April 9, 2014 Try the query above. Add the BagFenceRound_DZ Scaffolding_DZ from cen. Then make a task to execute this query every week. Done :) What will this exactly do? DELETE FROM `Object_DATA` WHERE `Object_DATA`.`Classname` NOT LIKE 'Tent%' AND `Object_DATA`.`Classname` NOT LIKE '%Locked' AND `Object_DATA`.`Classname` NOT LIKE 'Land%' AND `Object_DATA`.`Classname` NOT LIKE 'Cinder%' AND `Object_DATA`.`Classname` NOT LIKE 'Wood%' AND `Object_DATA`.`Classname` NOT LIKE 'Metal%' AND `Object_DATA`.`Classname` NOT LIKE '%Storage%' AND `Object_DATA`.`Classname` NOT IN ('OutHouse_DZ', 'GunRack_DZ', 'WorkBench_DZ', 'Sandbag1_DZ', 'FireBarrel_DZ', 'DesertCamoNet_DZ', 'StickFence_DZ', 'LightPole_DZ', 'DeerStand_DZ', 'ForestLargeCamoNet_DZ', 'Plastic_Pole_EP1_DZ', 'Hedgehog_DZ', 'FuelPump_DZ', 'Fort_RazorWire', 'SandNest_DZ', 'ForestCamoNet_DZ', 'Fence_corrugated_DZ', 'CanvasHut_DZ', 'Generator_DZ') AND `Object_DATA`.`LastUpdated` < NOW() - INTERVAL 7 DAY; Link to comment Share on other sites More sharing options...
Guest Posted April 9, 2014 Report Share Posted April 9, 2014 What will this exactly do? DELETE FROM `Object_DATA` WHERE `Object_DATA`.`Classname` NOT LIKE 'Tent%' AND `Object_DATA`.`Classname` NOT LIKE '%Locked' AND `Object_DATA`.`Classname` NOT LIKE 'Land%' AND `Object_DATA`.`Classname` NOT LIKE 'Cinder%' AND `Object_DATA`.`Classname` NOT LIKE 'Wood%' AND `Object_DATA`.`Classname` NOT LIKE 'Metal%' AND `Object_DATA`.`Classname` NOT LIKE '%Storage%' AND `Object_DATA`.`Classname` NOT IN ('OutHouse_DZ', 'GunRack_DZ', 'WorkBench_DZ', 'Sandbag1_DZ', 'FireBarrel_DZ', 'DesertCamoNet_DZ', 'StickFence_DZ', 'LightPole_DZ', 'DeerStand_DZ', 'ForestLargeCamoNet_DZ', 'Plastic_Pole_EP1_DZ', 'Hedgehog_DZ', 'FuelPump_DZ', 'Fort_RazorWire', 'SandNest_DZ', 'ForestCamoNet_DZ', 'Fence_corrugated_DZ', 'CanvasHut_DZ', 'Generator_DZ') AND `Object_DATA`.`LastUpdated` < NOW() - INTERVAL 7 DAY; Didn´t tryed the new code but it should delete every car (not locked) which is untouched for 7 days. CAUTION:ALWAYS DO A SELECT * FIRST !!!!!!! to see if it is the desired selection. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now