![Trending Articles on Technical and Non Technical topics](/images/trending_categories.jpeg)
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to select from a set of integers in MySQL?
To select from a set of integers, you can use UNION.
Following is the syntax −
SELECT yourValue1 UNION SELECT yourValue2 UNION SELECT yourValue3 UNION SELECT yourValue4 . . . . N
Let us implement the above syntax to select from a set of integers in MySQL −
mysql> SELECT 1000 UNION SELECT 2000 UNION SELECT 3000 UNION SELECT 4000 UNION SELECT 5000 UNION SELECT 6000 UNION SELECT 7000;
This will produce the following output −
+------+ | 1000 | +------+ | 1000 | | 2000 | | 3000 | | 4000 | | 5000 | | 6000 | | 7000 | +------+ 7 rows in set (0.03 sec)
Advertisements