随笔分类 -  数据库编程

SQLSever,Oracle,PostgreSQL,MySQL,DB2,SQLite,MongoDB,HBase
摘要:--上一月,上一年 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™ 阅读(385) 评论(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™ 阅读(331) 评论(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™ 阅读(445) 评论(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™ 阅读(465) 评论(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™ 阅读(429) 评论(0) 推荐(0)
摘要:实体类生成: 数据处理层: 阅读全文
posted @ 2018-09-19 16:44 ®Geovin Du Dream Park™ 阅读(419) 评论(0) 推荐(0)
摘要:如果有成熟的架构,如何根据数据库关系的表、视图等,进行代码生成架构?减少写代码的时间? 主、外键关联要考虑 实体类层: 数据处理层: 用于UI层要操作: 阅读全文
posted @ 2018-09-14 15:17 ®Geovin Du Dream Park™ 阅读(246) 评论(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™ 阅读(517) 评论(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™ 阅读(496) 评论(0) 推荐(0)
摘要:根据以上的代码生成的表,自动生成的简单的添加、删除、修改、查询的存储过程(关联还没有考虑,可以考虑进去) 自动生成实体(老版的)未考虑默认值 阅读全文
posted @ 2018-04-27 11:50 ®Geovin Du Dream Park™ 阅读(493) 评论(1) 推荐(0)
摘要:http://dcx.sybase.com/1101/en/dbprogramming_en11/ianywhere-data-sqlanywhere-saconnection-getschem6330755502-0.html http://razorsql.com/articles/sybase 阅读全文
posted @ 2018-02-09 11:28 ®Geovin Du Dream Park™ 阅读(503) 评论(0) 推荐(0)
摘要:讀取數据如下: http://www.dofactory.com/reference/connection-strings ARSoft.Tools.Net2.2.dll https://github.com/alexreinert/ARSoft.Tools.Net 阅读全文
posted @ 2018-02-08 16:06 ®Geovin Du Dream Park™ 阅读(673) 评论(0) 推荐(0)
摘要:https://github.com/mono/old-code https://wiki.scn.sap.com/wiki/display/SQLANY/SQL+Anywhere+and+Microsoft+.NET http://www.mono-project.com/docs/databas 阅读全文
posted @ 2018-02-05 17:42 ®Geovin Du Dream Park™ 阅读(1458) 评论(1) 推荐(1)
摘要:运行pgAdmin出现”pgAdmin 4 the application server could not be contant“ 窗口。 参考:https://stackoverflow.com/questions/40083391/postgresql-cant-connect-applica 阅读全文
posted @ 2017-12-25 13:26 ®Geovin Du Dream Park™ 阅读(3648) 评论(0) 推荐(1)
摘要:--step 1 : 修改数据库名称 USE master GO ALTER DATABASE GeovinDuCms SET SINGLE_USER WITH ROLLBACK IMMEDIATE GO EXEC master..sp_renamedb 'GeovinDuCms','DuCms' GO ALTER DATABASE DB_SHANGHAI SET MULTI_USER GO ... 阅读全文
posted @ 2017-10-17 17:52 ®Geovin Du Dream Park™ 阅读(722) 评论(0) 推荐(0)
摘要:---涂聚文 2017-9-28 SELECT VipExamMailProjectId,VipExamMailStaffID FROM VipExamMailRecord WHERE VipExamMailProjectId = 1 GROUP BY VipExamMailStaffID,VipExamMailProjectId HAVING COUNT(1)>1 ORDER ... 阅读全文
posted @ 2017-09-27 17:08 ®Geovin Du Dream Park™ 阅读(777) 评论(0) 推荐(1)
摘要:--------------------------------------------------------------------- -- Inside Microsoft SQL Server 2008: T-SQL Querying (MSPress, 2009) -- Chapter 12 - Graphs, Trees, Hierarchies and Recursive Quer... 阅读全文
posted @ 2017-09-12 15:08 ®Geovin Du Dream Park™ 阅读(336) 评论(0) 推荐(0)
摘要:MySQL: sql server : SQL Server Metadata Toolkit 2005 - 2014 https://sqlmetadata.codeplex.com/ Automatic Graph Layout https://github.com/Microsoft/auto 阅读全文
posted @ 2017-07-05 10:08 ®Geovin Du Dream Park™ 阅读(357) 评论(0) 推荐(0)
摘要:---查看所有存储过程或视图的位置 select a.name,a.[type],b.[definition] from sys.all_objects a,sys.sql_modules b where a.is_ms_shipped=0 and a.object_id = b.object_id and a.[type] in ('P','V','AF') order by a.[nam... 阅读全文
posted @ 2017-06-27 16:11 ®Geovin Du Dream Park™ 阅读(553) 评论(0) 推荐(0)
摘要:--------------------------------------------------------------------- -- Road System 道路 --------------------------------------------------------------------- -- Listing 9-3: DDL & Sample Data for C... 阅读全文
posted @ 2017-06-19 15:56 ®Geovin Du Dream Park™ 阅读(519) 评论(0) 推荐(1)