"MySQL ENUM"의 두 판 사이의 차이

잔글 (봇: 자동으로 텍스트 교체 (-</source> +</syntaxhighlight>, -<source +<syntaxhighlight ))
 
5번째 줄: 5번째 줄:
*가능한 값: 지정한 값들 + [[NULL]] + [[빈문자열]](<nowiki>''</nowiki>)
*가능한 값: 지정한 값들 + [[NULL]] + [[빈문자열]](<nowiki>''</nowiki>)


<source lang='mysql'>
<syntaxhighlight lang='mysql'>
CREATE TABLE shirts (
CREATE TABLE shirts (
     name VARCHAR(40),
     name VARCHAR(40),
     size ENUM('x-small', 'small', 'medium', 'large', 'x-large')
     size ENUM('x-small', 'small', 'medium', 'large', 'x-large')
);
);
</source>
</syntaxhighlight>
<source lang='console'>
<syntaxhighlight lang='console'>
mysql> SELECT column_type FROM information_schema.columns WHERE table_name='shirts' AND column_name='size';
mysql> SELECT column_type FROM information_schema.columns WHERE table_name='shirts' AND column_name='size';
+----------------------------------------------------+
+----------------------------------------------------+
19번째 줄: 19번째 줄:
+----------------------------------------------------+
+----------------------------------------------------+
1 row in set (0.00 sec)
1 row in set (0.00 sec)
</source>
</syntaxhighlight>


==같이 보기==
==같이 보기==

2023년 10월 31일 (화) 12:48 기준 최신판

1 개요[ | ]

MySQL ENUM Type
MySQL ENUM 타입
  • MySQL의 열거형 타입
  • 가능한 값: 지정한 값들 + NULL + 빈문자열('')
CREATE TABLE shirts (
    name VARCHAR(40),
    size ENUM('x-small', 'small', 'medium', 'large', 'x-large')
);
mysql> SELECT column_type FROM information_schema.columns WHERE table_name='shirts' AND column_name='size';
+----------------------------------------------------+
| column_type                                        |
+----------------------------------------------------+
| enum('x-small','small','medium','large','x-large') |
+----------------------------------------------------+
1 row in set (0.00 sec)

2 같이 보기[ | ]

3 참고[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}