随笔分类 -  数据库

SqlServer,MySql 实用语句
摘要:1 创建测试表 create table T_20211111 ( Id int, Score decimal(10,2) ); 2.1 MySql 不重复插入语句 使用 dual 保证 Id 不重复插入到表中 insert into T_20211111(Id,Score) select 1,12 阅读全文
posted @ 2021-11-11 22:14 温故纳新 阅读(44) 评论(0) 推荐(0) 编辑
摘要:sql server begin tran update Person set Name='20210906_3' where id=1; -- ROLLBACK -- 回滚事务 -- COMMIT -- 提交事务 mysql begin; update Person set Name='20210 阅读全文
posted @ 2021-09-06 11:50 温故纳新 阅读(73) 评论(0) 推荐(0) 编辑
摘要:sql server -- 将查询 select * from user1 的结果插入到新表user2 select * into user2 from user1; mysql create table user2 (select * from user1); 阅读全文
posted @ 2021-08-06 16:31 温故纳新 阅读(513) 评论(0) 推荐(0) 编辑
摘要:1 创建测试表和测试数据 -- 创建测试表 create table User1 ( id int, name nvarchar(20), Age int ); create table User2 ( id int, name nvarchar(20), Age int ); -- 插入测试数据 阅读全文
posted @ 2021-08-06 16:14 温故纳新 阅读(656) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示