随笔分类 -  数据库编程

SQLSever,Oracle,PostgreSQL,MySQL,DB2,SQLite,MongoDB,HBase
摘要:--行列转换 drop table geovindu create table geovindu (ID int,ChangeName nvarchar(25),Number1 int,Number2 int) insert into geovindu select 1,'购物换领',10,1 un 阅读全文
posted @ 2022-07-07 12:06 ®Geovin Du Dream Park™ 阅读(21) 评论(0) 推荐(0) 编辑
摘要:/* create database geovindu; 两数据库之间的一个类似表,进行一个表的操作添加,修改时的同步操作的触发器操作 use geovindu; create database DuMap go use DuMap go -- Geovin Du,涂聚文 --Geovin Du, 阅读全文
posted @ 2022-03-06 14:31 ®Geovin Du Dream Park™ 阅读(27) 评论(0) 推荐(0) 编辑
摘要:--sql server 2012 及以上 SELECT * FROM BookKindList ORDER BY (SELECT NULL) OFFSET 0 ROWS FETCH NEXT 3 ROWS ONLY go -- geovindu Geovin Du 涂聚文 Declare @Pag 阅读全文
posted @ 2021-12-28 15:14 ®Geovin Du Dream Park™ 阅读(46) 评论(0) 推荐(0) 编辑
摘要:sql server - Parent/Child hierarchy tree view - Stack Overflow declare @pc table(CHILD_ID int, PARENT_ID int, [NAME] varchar(80)); insert into @pc sel 阅读全文
posted @ 2021-09-18 14:56 ®Geovin Du Dream Park™ 阅读(53) 评论(0) 推荐(0) 编辑
摘要:DROP TABLE IF EXISTS `dudept`; CREATE TABLE `dudept` ( `Id` int(11) NOT NULL AUTO_INCREMENT comment 'ID', `deptCode` varchar(10) CHARACTER SET utf8 CO 阅读全文
posted @ 2020-08-29 11:30 ®Geovin Du Dream Park™ 阅读(288) 评论(0) 推荐(0) 编辑
摘要:--查看数据库中所有触发器 https://docs.microsoft.com/en-us/sql/t-sql/statements/create-trigger-transact-sql?view=sql-server-ver15 -- 涂聚文(Geovin Du) edit https://w 阅读全文
posted @ 2020-08-12 17:36 ®Geovin Du Dream Park™ 阅读(190) 评论(0) 推荐(0) 编辑
摘要:自动增长跳至1001 https://stackoverflow.com/questions/17587094/identity-column-value-suddenly-jumps-to-1001-in-sql-server --1. 使用序列 (Sequence) https://docs.m 阅读全文
posted @ 2020-08-05 10:48 ®Geovin Du Dream Park™ 阅读(280) 评论(0) 推荐(0) 编辑
摘要:用的Toad for Oracle 12.1 编辑,Oracle 10g 阅读全文
posted @ 2019-12-20 13:03 ®Geovin Du Dream Park™ 阅读(396) 评论(0) 推荐(0) 编辑
摘要:--上一月,上一年 select add_months(sysdate,-1) last_month,add_months(sysdate,-12) last_year from dual; --下一月,下一年 select add_months(sysdate,1) last_month,add_months(sysdate,12) last_year from dual; --当月最后一... 阅读全文
posted @ 2018-11-27 11:43 ®Geovin Du Dream Park™ 阅读(379) 评论(0) 推荐(0) 编辑
摘要:---https://docs.oracle.com/cd/B19306_01/server.102/b14200/statements_8003.htm drop user geovin; drop user geovindu; create user geovindu identified by ORCA; --oracle用户创建及权限设置 create user geovin ... 阅读全文
posted @ 2018-11-27 10:03 ®Geovin Du Dream Park™ 阅读(316) 评论(0) 推荐(0) 编辑
摘要:-- 当前日期时间 select now(); select now(3);-- 保留3位毫秒数 SELECT NOW(6); -- 保留6位毫秒数 -- 当前日期和时间 至秒 select current_timestamp; select current_timestamp(3); select 阅读全文
posted @ 2018-11-16 14:42 ®Geovin Du Dream Park™ 阅读(438) 评论(0) 推荐(0) 编辑
摘要:select CONVERT(nvarchar(50), '2018-10-10 10:13:32.000', 126) select convert(nvarchar(MAX), '2018-10-10 10:13:32.999',126) -- 考试记录(员工答题答案,项目ID,题目ID,员工ID,原答案,要顯示測驗日期時間、答案(只有英文字母都 還有同事姓名及分行 IF EXISTS... 阅读全文
posted @ 2018-10-11 11:21 ®Geovin Du Dream Park™ 阅读(456) 评论(0) 推荐(0) 编辑
摘要:-- 查询外键 涂聚文 (Geovin Du) select concat(table_name, '.', column_name) as 'foreign key', concat(referenced_table_name, '.', referenced_column_name) as 'references' from information_sch... 阅读全文
posted @ 2018-09-28 16:56 ®Geovin Du Dream Park™ 阅读(421) 评论(0) 推荐(0) 编辑
摘要:实体类生成: 数据处理层: 阅读全文
posted @ 2018-09-19 16:44 ®Geovin Du Dream Park™ 阅读(414) 评论(0) 推荐(0) 编辑
摘要:如果有成熟的架构,如何根据数据库关系的表、视图等,进行代码生成架构?减少写代码的时间? 主、外键关联要考虑 实体类层: 数据处理层: 用于UI层要操作: 阅读全文
posted @ 2018-09-14 15:17 ®Geovin Du Dream Park™ 阅读(239) 评论(0) 推荐(0) 编辑
摘要:-- 统计 select count(*) as '当天记录数' from web_product where date(p_createtime) = curdate(); select count(*) as '当天记录数' from web_product where to_days(p_createtime) = to_days(now()); SELECT count(... 阅读全文
posted @ 2018-08-24 13:01 ®Geovin Du Dream Park™ 阅读(496) 评论(0) 推荐(0) 编辑
摘要:Since browser detection can be tricky and very slow, I compared a few packages.http://thadafinser.github.io/UserAgentParserComparison/v5/index.htmlhtt 阅读全文
posted @ 2018-07-06 11:24 ®Geovin Du Dream Park™ 阅读(489) 评论(0) 推荐(0) 编辑
摘要:根据以上的代码生成的表,自动生成的简单的添加、删除、修改、查询的存储过程(关联还没有考虑,可以考虑进去) 自动生成实体(老版的)未考虑默认值 阅读全文
posted @ 2018-04-27 11:50 ®Geovin Du Dream Park™ 阅读(488) 评论(1) 推荐(0) 编辑

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5
点击右上角即可分享
微信分享提示