Tips Cara Menciptakan Table Temporary Di Mysql

Pada tutorial MySQL kali ini, kita akan mencar ilmu perihal Cara Membuat Table Temporary. Sesuai dengan namanya, table temporary ialah table...

A+ A-
Dan ternyata, table temporary yang telah Anda buat tidak ada di daftar table. Itu alasannya ialah perintah SHOW TABLES hanya menampilkan table-table yang actual bukan temporer.

Sekarang coba Anda tampilkan struktur dan data-data dari table temporary dengan menjalankan perintah berikut ini:

mysql> DESC employee_temp; +---------------+---------------+------+-----+---------+-------+ | Field         | Type          | Null | Key | Default | Extra | +---------------+---------------+------+-----+---------+-------+ | employee_id   | varchar(5)    | NO   |     | NULL    |       | | employee_name | varchar(20)   | NO   |     | NULL    |       | | gender        | char(1)       | NO   |     | NULL    |       | | address       | varchar(20)   | YES  |     | NULL    |       | | salary        | decimal(10,0) | YES  |     | NULL    |       | | departemen    | varchar(5)    | NO   |     | NULL    |       | +---------------+---------------+------+-----+---------+-------+ 6 rows in set (0.00 sec) 
mysql> SELECT * FROM employee_temp; +-------------+---------------+--------+----------+---------+------------+ | employee_id | employee_name | gender | address  | salary  | departemen | +-------------+---------------+--------+----------+---------+------------+ | 001         | Nursalim      | L      | Jakarta  | 3000000 | IT         | | 002         | Naura         | P      | Bandung  | 2000000 | HRD        | | 003         | Ahmad         | L      | Semarang | 5000000 | ACC        | | 004         | Nani          | P      | Surabaya | 2500000 | FIN        | | 005         | Nurul         | P      | Tegal    | 4500000 | FIN        | +-------------+---------------+--------+----------+---------+------------+ 5 rows in set (0.00 sec) 

Sekarang coba Anda keluar dari MySQL console dengan mengetikan perintah 'quit' ibarat berikut ini:

mysql> quit Bye 

Coba Anda masuk ke MySQL console kembali dan tampilkan data dari table temporary diatas.

# mysql -u root Welcome to the MySQL monitor.  Commands end with ; or \g. Your MySQL connection id is 4 Server version: 5.5.36 MySQL Community Server (GPL)  Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.  Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.  Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.  mysql> use hris; Database changed mysql> SELECT * FROM employee_temp; ERROR 1146 (42S02): Table 'hris.employee_temp' doesn't exist 

Dan ternyata, table temporary yang telah Anda buat sudah tidak ada..hehehe..

Related

MySQL 4358400870904726227

Technology

Hot in weekRecentComments

Hot in week

Recent

Comments

item