博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
mysql 字段添加以及删除
阅读量:4963 次
发布时间:2019-06-12

本文共 1810 字,大约阅读时间需要 6 分钟。

 

mysql> select * from user;+------+-----------+-----------+| id   | name      | address   |+------+-----------+-----------+|    1 | xiaoming  | beijing   ||    2 | xiaobai   | shandong  ||    3 | xiaohong  | suzhou    ||    4 | xiaohei   | changchun ||    5 | xiaoli    | dongjing  ||    6 | xiaohuang | meiguo    ||    1 | xiaoming  | beijing   ||    1 | xiaoming  | beijing   ||    1 | xiaoming  | beijing   |+------+-----------+-----------+9 rows in set (0.00 sec)mysql> alter table user add ziduan char(10) null;Query OK, 0 rows affected (0.05 sec)Records: 0  Duplicates: 0  Warnings: 0mysql> select * from user;+------+-----------+-----------+--------+| id   | name      | address   | ziduan |+------+-----------+-----------+--------+|    1 | xiaoming  | beijing   | NULL   ||    2 | xiaobai   | shandong  | NULL   ||    3 | xiaohong  | suzhou    | NULL   ||    4 | xiaohei   | changchun | NULL   ||    5 | xiaoli    | dongjing  | NULL   ||    6 | xiaohuang | meiguo    | NULL   ||    1 | xiaoming  | beijing   | NULL   ||    1 | xiaoming  | beijing   | NULL   ||    1 | xiaoming  | beijing   | NULL   |+------+-----------+-----------+--------+9 rows in set (0.00 sec)mysql> alter table user drop column ziduan;Query OK, 0 rows affected (0.06 sec)Records: 0  Duplicates: 0  Warnings: 0mysql> select * from user;+------+-----------+-----------+| id   | name      | address   |+------+-----------+-----------+|    1 | xiaoming  | beijing   ||    2 | xiaobai   | shandong  ||    3 | xiaohong  | suzhou    ||    4 | xiaohei   | changchun ||    5 | xiaoli    | dongjing  ||    6 | xiaohuang | meiguo    ||    1 | xiaoming  | beijing   ||    1 | xiaoming  | beijing   ||    1 | xiaoming  | beijing   |+------+-----------+-----------+9 rows in set (0.00 sec)

 

 

 

转载于:https://www.cnblogs.com/sea-stream/p/11312845.html

你可能感兴趣的文章
HDU 2717 Catch That Cow (bfs)
查看>>
Visual Studio 2010中创建ASP.Net Web Service
查看>>
UIAlertView用法
查看>>
openstack cinder-volume 的高可用(HA)
查看>>
庖丁解牛Linux内核分析 0x00:《庖丁解牛》
查看>>
C语言scanf函数详细解释(转载)
查看>>
【XSY2921】yja 拉格朗日乘法
查看>>
java基本语法——数组
查看>>
编写一个爬虫类库——(一)想法
查看>>
Jquery EasyUI中treegrid的中右键菜单和一般按钮同时绑定事件时的怪异事件
查看>>
test for python thread
查看>>
C++拷贝构造函数与 = 重载
查看>>
新概念4-39
查看>>
(poj)1502 MPI Maelstrom
查看>>
Longest Common Substring SPOJ - LCS (后缀自动机)
查看>>
jsoncpp简介、下载、编译、使用
查看>>
如何通过 AAR 形式集成 leakcanary-android 服务
查看>>
CodeForces Round #527 (Div3) D1. Great Vova Wall (Version 1)
查看>>
xvid x264
查看>>
置顶目录
查看>>