
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
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