
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
List Temporary Table Columns in MySQL
To list temporary table columns in MySQL, let us first create a temporary table.
Here’s an example. We have created a temporary table with some columns that includes the details of a student −
mysql> CREATE TEMPORARY TABLE DemoTable745 ( StudentId int NOT NULL AUTO_INCREMENT PRIMARY KEY, StudentName varchar(100), StudentAge int, StudentAddress varchar(100), StudentCountryName varchar(20) ); Query OK, 0 rows affected (0.00 sec)
Following is the query to list temporary table columns in MySQL−
mysql> show columns from DemoTable745;
This will produce the following output -
+--------------------+--------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +--------------------+--------------+------+-----+---------+----------------+ | StudentId | int(11) | NO | PRI | NULL | auto_increment | | StudentName | varchar(100) | YES | | NULL | NULL | | StudentAge | int(11) | YES | | NULL | NULL | | StudentAddress | varchar(100) | YES | | NULL | NULL | | StudentCountryName | varchar(20) | YES | | NULL | NULL | +--------------------+--------------+------+-----+---------+----------------+ 5 rows in set (0.05 sec)
Advertisements