当前位置:网站首页>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) 顺序
边栏推荐
- LVM operation
- Primary key policy problem
- Multi line display and single line display of tqdm
- [AI application] Hikvision ivms-4200 software installation
- QT learning diary 7 - qmainwindow
- 金山云——2023届暑期实习
- 二叉树专题--AcWing 3540. 二叉搜索树建树(实用板子 构建二叉搜索树 并输出前、中、后序遍历)
- 二叉树专题--AcWing 47. 二叉树中和为某一值的路径(前序遍历)
- Binary tree topic -- Luogu p3884 [jloi2009] binary tree problem (DFS for binary tree depth BFS for binary tree width Dijkstra for shortest path)
- Iii. Système de démarrage et d'horloge à puce
猜你喜欢
[play with FPGA learning 2 in simple terms ----- design skills (basic grammar)]
TIPC addressing 2
Special topic of binary tree -- acwing 19 The next node of the binary tree (find the successor of the node in the tree)
How does the whole network display IP ownership?
I STM32 development environment, keil5/mdk5.14 installation tutorial (with download link)
【深入浅出玩转FPGA学习3-----基本语法】
Flink two Open, implement Batch Lookup join (attached source)
Tick Data and Resampling
PKG package manager usage instance in FreeBSD
从攻击面视角,看信创零信任方案实践
随机推荐
三.芯片啟動和時鐘系統
How to use ide to automatically sign and debug Hongmeng application
2022 love analysis · panoramic report of digital manufacturers of state-owned enterprises
Indexer in C #
启牛商学院给的股票账户安全吗?能开户吗?
Resources读取2d纹理 转换为png格式
【深入浅出玩转FPGA学习5-----复位设计】
The working day of the month is calculated from the 1st day of each month
[quick application] there are many words in the text component. How to solve the problem that the div style next to it will be stretched
【IDEA】使用插件一键逆向生成代码
Leetcode 182 Find duplicate email (2022.07.01)
MTK full dump grab
C# 文件与文件夹操作
Special topic of binary tree -- acwing 3384 Binary tree traversal (known preorder traversal, while building a tree, while outputting middle order traversal)
Win11 arm system configuration Net core environment variable
Special topic of binary tree -- acwing 1589 Building binary search tree
QT learning diary 8 - resource file addition
ren域名有价值吗?值不值得投资?ren域名的应用范围有哪些?
ImportError: cannot import name ‘Digraph‘ from ‘graphviz‘
webauthn——官方开发文档