Pages

Wednesday, October 23, 2013

Membuat Temporary Tabel pada Database MySQL



Tidak hanya Sql server saja yang bisa membuat tabel temporary,
Database Gratisan ini(MySQL) juga bisa melakukanya :


Berikut ini contoh nya:





Create temporary table :


CREATE TEMPORARY TABLE Temp_employee
SELECT m.em_emplcode,
       m.em_emplname,
       m.em_sex,
       s.section_code
FROM master_employee m
INNER JOIN master_section s ON m.em_code = s.section_code
ORDER BY total ASC


Untuk melihat Hasilnya :


SELECT * FROM Temp_employee


Untuk Menghapus Table Temporary :


DROP TEMPORARY TABLE Temp_employee

No comments:

Post a Comment