Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Selected Reading
Insert multiple values in a temporary table with a single MySQL query?
Let us first create a table −
mysql> create temporary table DemoTable ( SerialNumber int ); Query OK, 0 rows affected (0.00 sec)
Insert some records in the table using insert command. Here, we are inserting multiple values in a temporary table −
mysql> insert into DemoTable values(1),(2),(3),(4),(5),(6),(7),(8); Query OK, 8 rows affected (0.00 sec) Records: 8 Duplicates: 0 Warnings: 0
Display all records from the table using select statement −
mysql> select *from DemoTable;
This will produce the following output −
+--------------+ | SerialNumber | +--------------+ | 1 | | 2 | | 3 | | 4 | | 5 | | 6 | | 7 | | 8 | +--------------+ 8 rows in set (0.00 sec)
Advertisements
