Advertisement
Haycore

update_php

Jan 25th, 2017
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 2.36 KB | None | 0 0
  1. UPDATE handelsposten_bestand SET Bestand = (SELECT items.Quantity FROM items WHERE items.ContainerID=4161 and items.ObjectTypeID=handelsposten_bestand.ID);
  2. UPDATE handelsposten_bestand SET QualitaetVK = (SELECT items.Quality FROM items WHERE items.ContainerID=4161 and items.ObjectTypeID=handelsposten_bestand.ID);
  3. UPDATE handelsposten_bestand set PreisVK = CASE WHEN Bestand >= '900' THEN BasePrice*0.25 WHEN Bestand >= '500' THEN BasePrice*0.5 WHEN Bestand >= '250' THEN BasePrice*0.75 ELSE BasePrice END;
  4. UPDATE handelsposten_bestand set PreisAK = CASE WHEN Bestand >= '1000' THEN 0 WHEN Bestand >= '900' THEN BasePrice*0.15 WHEN Bestand >= '500' THEN BasePrice*0.3 WHEN Bestand >= '250' THEN BasePrice*0.60 ELSE BasePrice*0.75 END;
  5. UPDATE handelsposten_bestand set MinAKQuali = CASE WHEN Bestand < '100' THEN AddQuali WHEN Bestand >= '100' THEN QualitaetVK-5 ELSE 60 END;
  6. UPDATE handelsposten_bestand set AnkaufMax = Begrenzung-Bestand;
  7. DELETE FROM handelsposten_ankauf;
  8. INSERT INTO handelsposten_ankauf (ID, MengeAnkauf, IstAKQuali) SELECT ObjectTypeID, Quantity, Quality FROM items WHERE ContainerID='4185';
  9. UPDATE handelsposten_ankauf SET Name = (SELECT handelsposten_bestand.Name FROM handelsposten_bestand WHERE handelsposten_bestand.ID=handelsposten_ankauf.ID);
  10. UPDATE handelsposten_ankauf SET PreisAK = (SELECT handelsposten_bestand.PreisAK FROM handelsposten_bestand WHERE handelsposten_bestand.ID=handelsposten_ankauf.ID);
  11. UPDATE handelsposten_ankauf SET MinAKQuali = (SELECT handelsposten_bestand.MinAKQuali FROM handelsposten_bestand WHERE handelsposten_bestand.ID=handelsposten_ankauf.ID);
  12. UPDATE handelsposten_ankauf SET AnkaufMax = (SELECT handelsposten_bestand.AnkaufMax FROM handelsposten_bestand WHERE handelsposten_bestand.ID=handelsposten_ankauf.ID);
  13. UPDATE handelsposten_ankauf SET PreisGesamt = PreisAK*MengeAnkauf;
  14. DELETE FROM handelsposten_verkauf;
  15. INSERT INTO handelsposten_verkauf (ID, MengeVK, QualiVK) SELECT ObjectTypeID, Quantity, Quality FROM items WHERE ContainerID='4496';
  16. UPDATE handelsposten_verkauf SET Name = (SELECT handelsposten_bestand.Name FROM handelsposten_bestand WHERE handelsposten_bestand.ID=handelsposten_verkauf.ID);
  17. UPDATE handelsposten_verkauf SET PreisVK = (SELECT handelsposten_bestand.PreisVK FROM handelsposten_bestand WHERE handelsposten_bestand.ID=handelsposten_verkauf.ID);
  18. UPDATE handelsposten_verkauf SET PreisGesamt = PreisVK*MengeVK;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement