代码语言
.
CSharp
.
JS
Java
Asp.Net
C
MSSQL
PHP
Css
PLSQL
Python
Shell
EBS
ASP
Perl
ObjC
VB.Net
VBS
MYSQL
GO
Delphi
AS
DB2
Domino
Rails
ActionScript
Scala
代码分类
文件
系统
字符串
数据库
网络相关
图形/GUI
多媒体
算法
游戏
Jquery
Extjs
Android
HTML5
菜单
网页交互
WinForm
控件
企业应用
安全与加密
脚本/批处理
开放平台
其它
【
MYSQL
】
mysql 枚举类型使用示例
作者:
Dezai.CN
/ 发布于
2013/6/8
/
1066
/* mysql> select * from employee_person; +----+-------------------------------------+---------+--------------------------+------------+------+----------+-----------------+----------+ | id | address | phone | email | birthday | sex | m_status | s_name | children | +----+-------------------------------------+---------+---------------------------+------------+------+----------+-----------------+----------+ | 1 | 200, Regina Street | 7176666 | net@hotmail.com | 1971-04-26 | M | Y | Ane Regina | NULL | | 2 | 1232 Alberta Road | 5553312 | jo@hotmail.com | 1968-03-02 | M | Y | Jane Van | 3 | | 3 | 90 Potter A | 3331211 | gp@ymail.com | 1967-09-22 | M | N | Sandhya Pil | 2 | | 4 | 202, Donna Street | 7176167 | twink@hotmail.com | 1976-08-09 | F | Y | Manish Sha | NULL | | 5 | Apartment #8, UBC, Van Street | 8973242 | holy@ymail.com | 1974-10-14 | F | N | NULL | NULL | | 6 | 46 SFU Street | 6451234 | kill@el.com | 1978-12-31 | M | N | NULL | NULL | | 7 | 432 Mercury Ave | 7932232 | mac@hotmail.com | 1966-08-21 | M | Y | Mary Shelly | 3 | | 8 | 8 Little YaleTown | 5442994 | edd@gmail.com | 1975-01-14 | M | N | NULL | NULL | | 9 | 64 Temp Road | 4327652 | nan@pmail.com | 1969-05-19 | M | Y | Man Nanda | 1 | | 10 | 132 Metro House, Henry Street | 5552376 | ra@hotmail.com | 1968-07-06 | M | N | NULL | NULL | | 11 | 1 Grace Town, Van Avenue | 5433879 | soundofsilence@boxer.net | 1957-11-04 | M | Y | Muriel Lovelace | 4 | | 12 | 97 Oakland Road | 5423311 | kingarthur@roundtable.org | 1968-02-15 | M | Y | Rina Brighton | 3 | | 13 | 543 Applegate Lane | 3434343 | levy@cmail.com | 1968-09-03 | F | Y | Matt Shi | 2 | | 14 | 76 Fish Street | 7432433 | tink@email.com | 1965-04-28 | M | N | NULL | NULL | | 15 | 98 Gun Street | 6500787 | danny@fhardy.com | 1966-06-23 | M | Y | Betty Cudly | 3 | | 16 | #5 Winnepag Homes | 5433243 | mike@cmail.com | 1964-03-06 | M | Y | Stella Stevens | 2 | | 17 | 652 Devon Building, 6th Jade Avenue | 5537885 | mona@darling.com | 1970-04-18 | F | Y | Edgar Alan | 1 | | 18 | Apartment #9, Together Towers | 5476565 | odessey@hotmail.com | 1973-10-09 | M | N | NULL | NULL | | 19 | Apartment #9, West Towers | 5476565 | jire@hotmail.com | 1973-01-20 | M | N | NULL | NULL | | 20 | 90 Yale Town | 7528326 | help@more.org | 1968-01-25 | F | N | NULL | NULL | | 21 | 4329 Eucalyptus Avenue | 4254863 | money@cold.com | 1964-06-13 | M | Y | Ruby Richer | 2 | +----+-------------------------------------+---------+---------------------------+------------+------+----------+-----------------+----------+ 21 rows in set (0.01 sec) mysql> select id, s_name -> from employee_person -> where m_status = 'Y'; +----+-----------------+ | id | s_name | +----+-----------------+ | 1 | Ane Regina | | 2 | Jane Van | | 4 | Manish Sha | | 7 | Mary Shelly | | 9 | Man Nanda | | 11 | Muriel Lovelace | | 12 | Rina Brighton | | 13 | Matt Shi | | 15 | Betty Cudly | | 16 | Stella Stevens | | 17 | Edgar Alan | | 21 | Ruby Richer | +----+-----------------+ 12 rows in set (0.00 sec) */ Drop table employee_person; CREATE TABLE employee_person ( id int unsigned not null primary key, address varchar(60), phone int, email varchar(60), birthday DATE, sex ENUM('M', 'F'), m_status ENUM('Y','N'), s_name varchar(40), children int ); INSERT INTO employee_person (id, address, phone, email, birthday, sex, m_status, s_name) values (1, '200, Regina Street', 7176666, 'net@hotmail.com', '1971-04-26', 'M', 'Y', 'Ane Regina'); INSERT INTO employee_person (id, address, phone, email, birthday, sex, m_status, s_name, children) values (2, '1232 Alberta Road', 5553312, 'jo@hotmail.com', '1968-03-02', 'M', 'Y', 'Jane Van', 3); INSERT INTO employee_person (id, address, phone, email, birthday, sex, m_status, s_name, children) values (3, '90 Potter A', 3331211, 'gp@ymail.com', '1967-09-22', 'M', 'N', 'Sandhya Pil', 2); INSERT INTO employee_person (id, address, phone, email, birthday, sex, m_status, s_name) values (4, '202, Donna Street', 7176167, 'twink@hotmail.com', '1976-08-09', 'F', 'Y', 'Manish Sha'); INSERT INTO employee_person (id, address, phone, email, birthday, sex, m_status) values (5, 'Apartment #8, UBC, Van Street', 8973242, 'holy@ymail.com', '1974-10-14', 'F', 'N'); INSERT INTO employee_person (id, address, phone, email, birthday, sex, m_status) values (6, '46 SFU Street', '6451234', 'kill@el.com', '1978-12-31', 'M', 'N'); INSERT INTO employee_person (id, address, phone, email, birthday, sex, m_status, s_name, children) values (7, '432 Mercury Ave', 7932232, 'mac@hotmail.com', '1966-8-21', 'M', 'Y', 'Mary Shelly', '3'); INSERT INTO employee_person (id, address, phone, email, birthday, sex, m_status) values (8, '8 Little YaleTown', 5442994, 'edd@gmail.com', '1975-01-14', 'M', 'N'); INSERT INTO employee_person (id, address, phone, email, birthday, sex, m_status, s_name, children) values (9, '64 Temp Road', 4327652, 'nan@pmail.com', '1969-05-19', 'M', 'Y', 'Man Nanda', '1'); INSERT INTO employee_person (id, address, phone, email, birthday, sex, m_status) values (10, '132 Metro House, Henry Street', 5552376, 'ra@hotmail.com', '1968-07-06', 'M', 'N'); INSERT INTO employee_person (id, address, phone, email, birthday, sex, m_status, s_name, children) values (11, '1 Grace Town, Van Avenue', 5433879, 'soundofsilence@boxer.net', '1957-11-04', 'M', 'Y', 'Muriel Lovelace', '4'); INSERT INTO employee_person (id, address, phone, email, birthday, sex, m_status, s_name, children) values (12, '97 Oakland Road', 5423311, 'kingarthur@roundtable.org', '1968-02-15', 'M', 'Y', 'Rina Brighton', 3); INSERT INTO employee_person (id, address, phone, email, birthday, sex, m_status, s_name, children) values (13, '543 Applegate Lane', 3434343, 'levy@cmail.com', '1968-09-03', 'F', 'Y', 'Matt Shi', '2'); INSERT INTO employee_person (id, address, phone, email, birthday, sex, m_status) values (14, '76 Fish Street', 7432433, 'tink@email.com', '1965-04-28', 'M', 'N'); INSERT INTO employee_person (id, address, phone, email, birthday, sex, m_status, s_name, children) values (15, '98 Gun Street', 6500787, 'danny@fhardy.com', '1966-06-23', 'M', 'Y', 'Betty Cudly', 3); INSERT INTO employee_person (id, address, phone, email, birthday, sex, m_status, s_name, children) values (16, '#5 Winnepag Homes', 5433243, 'mike@cmail.com', '1964-03-06', 'M', 'Y', 'Stella Stevens', 2); INSERT INTO employee_person (id, address, phone, email, birthday, sex, m_status, s_name, children) values (17, '652 Devon Building, 6th Jade Avenue', 5537885, 'mona@darling.com', '1970-04-18', 'F', 'Y', 'Edgar Alan', 1); INSERT INTO employee_person (id, address, phone, email, birthday, sex, m_status) values (18, 'Apartment #9, Together Towers', 5476565, 'odessey@hotmail.com', '1973-10-09', 'M', 'N'); INSERT INTO employee_person (id, address, phone, email, birthday, sex, m_status) values (19, 'Apartment #9, West Towers', 5476565, 'jire@hotmail.com', '1973-1-20', 'M', 'N'); INSERT INTO employee_person (id, address, phone, email, birthday, sex, m_status) values (20, '90 Yale Town', 7528326, 'help@more.org', '1968-01-25', 'F', 'N'); INSERT INTO employee_person (id, address, phone, email, birthday, sex, m_status, s_name, children) values (21, '4329 Eucalyptus Avenue', 4254863, 'money@cold.com', '1964-06-13', 'M', 'Y', 'Ruby Richer', 2); select * from employee_person; select id, s_name from employee_person where m_status = 'Y';
试试其它关键字
枚举类型
同语言下
.
MySQL按日期分组统计(按天统计,按月统计)
.
mysql 获取某个库下面所有表的所有数据(
.
查看表当前自增值
.
查看碎片较多的表
.
查看数据表较大的表
.
查看非InnoDB引擎表
.
根据某一字段值按照某一特定符转化为列数据
.
按时间段分组查询当天小时内数据
.
mysql json 使用 类型 查询 函数
.
按天数据统计
可能有用的
.
C#实现的html内容截取
.
List 切割成几份 工具类
.
SQL查询 多列合并成一行用逗号隔开
.
一行一行读取txt的内容
.
C#动态修改文件夹名称(FSO实现,不移动文件)
.
c# 移动文件或文件夹
.
c#图片添加水印
.
Java PDF转换成图片并输出给前台展示
.
网站后台修改图片尺寸代码
.
处理大图片在缩略图时的展示
Dezai.CN
贡献的其它代码
(
4037
)
.
多线程Socket服务器模块
.
生成随机密码
.
清除浮动样式
.
弹出窗口居中
.
抓取url的函数
.
使用base HTTP验证
.
div模拟iframe嵌入效果
.
通过header转向的方法
.
Session操作类
.
执行sqlite输入插入操作后获得自动编号的ID
Copyright © 2004 - 2024 dezai.cn. All Rights Reserved
站长博客
粤ICP备13059550号-3