- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
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 get the possible values for SET field in MySQL?
To get possible values for set field, you can use below syntax −
desc yourTableName yourSetColumnName;
Let us first create a table −
mysql> create table DemoTable ( Game set('Chess','Pig Dice','29 Card') ); Query OK, 0 rows affected (0.60 sec)
Following is the query to get available values for set field −
mysql> desc DemoTable Game;
This will produce the following output −
+-------+-----------------------------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-------+-----------------------------------+------+-----+---------+-------+ | Game | set('Chess','Pig Dice','29 Card') | YES | | NULL | | +-------+-----------------------------------+------+-----+---------+-------+ 1 row in set (0.02 sec)
- Related Articles
- MySQL query to set current date in the datetime field for all the column values
- Set all values in a MySQL field to 0?
- How can I get enum possible values in a MySQL database?
- MySQL query to get the max value with numeric values in varchar field?
- How to set default Field Value in MySQL?
- How can I get enum possible values in a MySQL database using PHP?
- MySQL query to get the next number in sequence for AUTO_INCREMENT field?
- Set ENUM in MySQL for column values
- How to get MySQL combined field result?
- MySQL query to set values for NULL occurrence
- How to map keys to values for an individual field in a MySQL select query?
- Set multiple values for custom columns in MySQL?
- Set custom messages for enum values in MySQL
- Display only the default values set for columns in MySQL
- MySQL query to set different combinations for values in a table?

Advertisements