当前位置:网站首页>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) 顺序
边栏推荐
- [play with FPGA learning 5 in simple terms ----- reset design]
- Is bond fund safe? Does the bond buying foundation lose principal?
- OpenMLDB Meetup No.4 会议纪要
- CentOS8之mysql基本用法
- 在网上开股票账户安全吗?我是新手,还请指导
- ros缺少catkin_pkg
- One trick to quickly realize custom application titlebar
- Static variables in static function
- Special topic of binary tree -- acwing 1589 Building binary search tree
- LVM operation
猜你喜欢

洛谷 P5536 【XR-3】核心城市(贪心 + 树形 dp 寻找树的中心)

What are the software product management systems? Inventory of 12 best product management tools

【AI应用】海康威视iVMS-4200软件安装

TIPC messaging3

JVM之垃圾回收器

Special topic of binary tree -- Logu p1229 traversal problem (the number of traversals in the middle order is calculated when the pre and post order traversals of the multiplication principle are know

二叉树专题--AcWing 47. 二叉树中和为某一值的路径(前序遍历)

八大排序汇总

Special topic of binary tree -- acwing 1497 Traversal of the tree (use post and mid order traversal to build a binary tree)

二叉树专题--AcWing 19. 二叉树的下一个节点(找树中节点的后继)
随机推荐
CentOS8之mysql基本用法
How to transfer event objects and user-defined parameters simultaneously in Huawei express applications
How does the whole network display IP ownership?
一.STM32的开发环境,keil5/MDK5.14安装教程(附下载链接)
spritejs
Internship report skywalking distributed link tracking?
[quick application] win7 system cannot run and debug projects using Huawei ide
Verilog and VHDL signed and unsigned number correlation operations
Special topic of binary tree -- Logu p1229 traversal problem (the number of traversals in the middle order is calculated when the pre and post order traversals of the multiplication principle are know
Special topic of binary tree -- acwing 18 Rebuild the binary tree (construct the binary tree by traversing the front and middle order)
Uncover the secrets of Huawei application market application statistics
enumrate的start属性的坑
What are the methods of adding elements to arrays in JS
ImportError: cannot import name ‘Digraph‘ from ‘graphviz‘
二叉树专题--AcWing 3384. 二叉树遍历(已知先序遍历 边建树 边输出中序遍历)
洛谷 P3398 仓鼠找 sugar(树上倍增 lca 判断树中两条路径是否相交 结论)
二叉树专题--AcWing 47. 二叉树中和为某一值的路径(前序遍历)
ros缺少catkin_pkg
Why does LabVIEW lose precision in floating point numbers
Jenkins安装