Articles Comments

{ Berbagi, Menulis, Dan Mengajar } Ilmu… » 7. Operating System » ini SQL Query Mendelete Database Milik Hotel / Dispenda / MYSQL

ini SQL Query Mendelete Database Milik Hotel / Dispenda / MYSQL

Ada tiga Tabel Penting yang harus di bersihkan untuk mengurangi beban server Aplikasi Pajak Hotel,

yaitu Tabel db_checkout_hotel, db_detail_reservasi, db_reservasi_hotel

Delete Data Dilakukan pada transaksi diluar 4 bulan terakhir

——–

USE dbHotelWismaKarya;
DELETE FROM db_checkout_hotel     WHERE waktu_checkout NOT LIKE ‘2015-11%’
AND waktu_checkout NOT LIKE ‘2015-10%’ AND waktu_checkout NOT LIKE ‘2015-09%’ AND waktu_checkout NOT LIKE ‘2015-08%’ ;

DELETE  FROM db_detail_reservasi WHERE checkin_date NOT LIKE ‘2015-11%’
AND checkin_date NOT LIKE ‘2015-10%’ AND checkin_date NOT LIKE ‘2015-09%’ AND checkin_date NOT LIKE ‘2015-08%’ ;

DELETE FROM db_reservasi_hotel WHERE reservation_date NOT LIKE ‘2015-11%’
AND reservation_date NOT LIKE ‘2015-10%’ AND reservation_date NOT LIKE ‘2015-09%’ AND reservation_date NOT LIKE ‘2015-08%’ ;

Filed under: 7. Operating System

Leave a Reply

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>