服务器下db(数据库)的执行

1、查看

objectivec 复制代码
select  * from xxxx(表名) where  xxx(列表)=1 and.......

正常写就行

2、插入


如果你想要在

SELECT

INSERT INTO ... SELECT

语句中将部分列保持不变,只改变一两列的值,可以在

语句中直接设置目标列的值,而其他列从源表中选择。

下面是一个示例,假设你想要将

target_table的某些列的值保持不变,只改变其中的一两列:

python 复制代码
INSERT INTO target_table (column1, column2, column3,column4, ...)
SELECT
source column1,--与target table中column1对应的值
source_column2,--与target_table中column2对应的值
'new_value_for_column3', --新值,替换 table中column3的值
'new_value_for_column4',-新值.替换 table中column4的值
source_column5,--与target_table中column5对应的值
source_column6--与target_table中column6对应的值
FROM source table
WHERE condition;

在这个示例中:

columnl和 column2从source_table中选择的列中取得值。

column3和column4直接赋予了新的值。

其余的列,如column5和column6,继续从

source_table中选择对应的列值。

3、修改

upset xxx(表名 ) set xx(列表)= xxx(新修改的内容)where xxx(列表)=1 and...

4、删除

objectivec 复制代码
delete from  xxx(表名 ) where  xxx(列表)=1 and.......
相关推荐
snow@li6 小时前
数据库:市场中都有哪些数据库 / 优缺点 使用情况
数据库
NoSi EFUL7 小时前
MySQL中ON DUPLICATE KEY UPDATE的介绍与使用、批量更新、存在即更新不存在则插入
android·数据库·mysql
河阿里7 小时前
SQL数据库:五大范式(NF)
数据库·sql·oracle
l1t8 小时前
DeepSeek总结的PostgreSQL 19查询提示功能
数据库·postgresql
chenxu98b10 小时前
MySQL如何执行.sql 文件:详细教学指南
数据库·mysql
刘晨鑫110 小时前
MongoDB数据库应用
数据库·mongodb
梦想的颜色10 小时前
mongoTemplate + Java 增删改查基础介绍
数据结构·数据库·mysql
小小小米粒11 小时前
redis命令集合
数据库·redis·缓存
herinspace11 小时前
管家婆实用贴-如何分离和附加数据库
开发语言·前端·javascript·数据库·语音识别
步辞12 小时前
Go语言怎么用channel做信号通知_Go语言channel信号模式教程【完整】
jvm·数据库·python