当前位置:网站首页>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) 顺序
边栏推荐
- Rest (XOR) position and thinking
- flink二开,实现了个 batch lookup join(附源码)
- SQLite modify column type
- Verilog 和VHDL有符号数和无符号数相关运算
- 二叉树专题--AcWing 47. 二叉树中和为某一值的路径(前序遍历)
- QT学习日记7——QMainWindow
- C# 文件与文件夹操作
- Implementation of six singleton modes
- [AI application] Hikvision ivms-4200 software installation
- Xiao Sha's pain (double pointer
猜你喜欢

The first white paper on agile practice in Chinese enterprises was released | complete download is attached

Importerror: impossible d'importer le nom « graph» de « graphviz»

ImportError: cannot import name ‘Digraph‘ from ‘graphviz‘

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
![[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](/img/5c/b0030fd5fbc07eb94013f2699c2a04.png)
[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

八大排序汇总

Special topic of binary tree -- acwing 3540 Binary search tree building (use the board to build a binary search tree and output the pre -, middle -, and post sequence traversal)

TIPC addressing 2

Pit of the start attribute of enumrate

JS——每次调用从数组里面随机取一个数,且不能与上一次为同一个
随机推荐
JS——每次调用从数组里面随机取一个数,且不能与上一次为同一个
TIPC Service and Topology Tracking4
TIPC messaging3
Special topic of binary tree -- acwing 3540 Binary search tree building (use the board to build a binary search tree and output the pre -, middle -, and post sequence traversal)
Huawei game failed to initialize init with error code 907135000
Verilog 和VHDL有符号数和无符号数相关运算
Gaode draws lines according to the track
Multi line display and single line display of tqdm
Win11 arm system configuration Net core environment variable
二叉树专题--P1030 [NOIP2001 普及组] 求先序排列
主键策略问题
Calculate the sum of sequences
V2X-Sim数据集(上海交大&纽约大学)
spritejs
TIPC introduction 1
C file and folder operation
通过券商经理的开户二维码开股票账户安全吗?还是去证券公司开户安全?
III Chip startup and clock system
webauthn——官方开发文档
TIPC Getting Started6