当前位置:网站首页>mysql 基本语句
mysql 基本语句
2022-07-02 09:32:00 【夕心o】
// 修改SQL中表名
alter table <原来的表名> rename to <新表名>;
// 表中添加新字段
alter table <表名> add <添加字段名> <字段类型>
// 表中更新某个字段
update <表名> set <更新字段名> = <值>
// 更新表中某一行中的一个列
update <表名> set <更新字段名>=<值> where <条件>
// 删除表中数据
delete from <表名> where <条件>
// 修改表名
alter table <表名> rename to <新表名>;
// sql 查找自定义排序顺序
select * from <表名>
order by case
when id = 102 then 1
when id = 99 then 2
when id = 100 then 3
when id = 101 then 4
else id end asc
// 最终获取的数据以 id (102, 99, 100, 101) 顺序
边栏推荐
- QT learning diary 7 - qmainwindow
- ImportError: cannot import name ‘Digraph‘ from ‘graphviz‘
- 高德根据轨迹画线
- JS——每次调用从数组里面随机取一个数,且不能与上一次为同一个
- 二叉树专题--AcWing 3384. 二叉树遍历(已知先序遍历 边建树 边输出中序遍历)
- QT learning diary 8 - resource file addition
- sql left join 主表限制条件写在on后面和写在where后面的区别
- Mongodb learning and sorting (condition operator, $type operator, limit() method, skip() method and sort() method)
- TIPC Service and Topology Tracking4
- 对毕业季即将踏入职场的年轻人的一点建议
猜你喜欢

How to implement tabbar title bar with list component

One trick to quickly realize custom application titlebar

Creation and use of unified links in Huawei applinking

Thanos Receiver

ctf 记录

金山云——2023届暑期实习

TIPC 寻址2

How does the whole network display IP ownership?
![二叉树专题--洛谷 P3884 [JLOI2009]二叉树问题(dfs求二叉树深度 bfs求二叉树宽度 dijkstra求最短路)](/img/c2/bb85b681af0f78b380b1d179c7ea49.png)
二叉树专题--洛谷 P3884 [JLOI2009]二叉树问题(dfs求二叉树深度 bfs求二叉树宽度 dijkstra求最短路)

The most detailed MySQL installation tutorial
随机推荐
TIPC Getting Started6
SQLite modify column type
Flink two Open, implement Batch Lookup join (attached source)
Pit of the start attribute of enumrate
Rest (XOR) position and thinking
二叉树专题--AcWing 18. 重建二叉树(利用前、中序遍历,构建二叉树)
主键策略问题
Tick Data and Resampling
[paid promotion] collection of frequently asked questions, recommended list FAQ
从攻击面视角,看信创零信任方案实践
enumrate的start属性的坑
TIPC Service and Topology Tracking4
ImportError: cannot import name ‘Digraph‘ from ‘graphviz‘
Regular and common formulas
高德根据轨迹画线
实验电镜距离测量之Matlab处理
What are the software product management systems? Inventory of 12 best product management tools
Summary of cases of players' disconnection and reconnection in Huawei online battle service
MTK full dump grab
php中self和static在方法中的区别