随笔分类 -  数据库编程

上一页 1 ··· 3 4 5 6 7
SQLSever,Oracle,PostgreSQL,MySQL,DB2,SQLite,MongoDB,HBase
摘要:SQLite sql script: SQLite 数据库连接字符 Csharp操作SQLite 添加返回值 Csharp操作Access添加返回值 https://system.data.sqlite.org/index.html/doc/trunk/www/downloads.wiki http 阅读全文
posted @ 2015-02-11 15:02 ®Geovin Du Dream Park™ 阅读(1010) 评论(0) 推荐(0) 编辑
摘要:create database Liber; use Liber; #顯示數据庫 20150210 Geovin Du 涂聚文 SHOW DATABASES; drop table BookKindList; #书目录 create table BookKindList ( BookKindID I 阅读全文
posted @ 2015-02-10 15:01 ®Geovin Du Dream Park™ 阅读(455) 评论(0) 推荐(0) 编辑
摘要:MySQL存储过程:#插入一条返回值涂聚文注DELIMITER $$ DROP PROCEDURE IF EXISTS `geovindu`.`proc_Insert_BookKindOut` $$ CREATE PROCEDURE `geovindu`.`proc_Insert_BookKindO... 阅读全文
posted @ 2015-02-10 11:39 ®Geovin Du Dream Park™ 阅读(431) 评论(0) 推荐(0) 编辑
摘要:Oracle: 阅读全文
posted @ 2015-01-24 13:52 ®Geovin Du Dream Park™ 阅读(1665) 评论(0) 推荐(0) 编辑
摘要:--Common Table Expressions(CTE)WITH HighSample (SampleId,SampleTitle,SampleContent) AS( SELECT SampleId,SampleTitle,SampleContent From CompetitionS... 阅读全文
posted @ 2015-01-21 11:50 ®Geovin Du Dream Park™ 阅读(527) 评论(0) 推荐(0) 编辑
摘要:---循环declare @n intdeclare @rowcount int declare @name varchar(50)create table #temp( id int identity(1,1), ColumnNme nvarchar(100))insert into #temp ... 阅读全文
posted @ 2015-01-15 11:52 ®Geovin Du Dream Park™ 阅读(321) 评论(0) 推荐(0) 编辑
摘要:--SQL Server 2005, 2008 or 2012:SELECT * FROM information_schema.tables--SQL Server 2000:SELECT * FROM sysobjects WHERE xtype='U' SELECT * FROM sysobj... 阅读全文
posted @ 2015-01-06 22:23 ®Geovin Du Dream Park™ 阅读(879) 评论(0) 推荐(0) 编辑
摘要:---sql: T-SQL 统计计算(父子關係,樹形,分級分類的統計)---2014-08-26 塗聚文(Geovin Du)CREATE PROCEDURE proc_Select_BookKindSumReportASDECLARE @temp TABLE( BookKindID IN... 阅读全文
posted @ 2014-08-26 12:54 ®Geovin Du Dream Park™ 阅读(795) 评论(0) 推荐(0) 编辑
摘要:--Parent-Child reationship --涂聚文 2014-08-25 --得位置的子節點函數表(包含本身) if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[GetBookPlaceChild 阅读全文
posted @ 2014-08-25 16:09 ®Geovin Du Dream Park™ 阅读(272) 评论(0) 推荐(0) 编辑
摘要:---树形(父子关系类)分级类统计(父子统计)--涂聚文 2014-08-14drop table BookKindListcreate table BookKindList( BookKindID INT IDENTITY(1,1) PRIMARY KEY, BookKindName ... 阅读全文
posted @ 2014-08-14 16:21 ®Geovin Du Dream Park™ 阅读(358) 评论(0) 推荐(0) 编辑
摘要:---1.以日期字符操作转换日期 如果是VIP1生日不对,可以以上传的数据日期为生日begindeclare @NowBirthday datetime, @birthday datetime,@stat datetime,@end datetime,@statbirthday datetime,... 阅读全文
posted @ 2014-07-17 15:35 ®Geovin Du Dream Park™ 阅读(433) 评论(0) 推荐(0) 编辑
摘要:--查询权限函数--1declare @names varchar(3000)set @names=''select @names=@names+isnull(AdminPermissFormName,'')+' , ' from BookAdminPermissTypeList where Ad... 阅读全文
posted @ 2014-06-20 18:21 ®Geovin Du Dream Park™ 阅读(361) 评论(0) 推荐(0) 编辑
摘要:---使用 UNION、INTERSECT 或 EXCEPT 运算符合并的所有查询必须在其目标列表中有相同数目的表达式select * from BookInfoList--存在不同的select BookInfoID,BookInfoBarCode from BookInfoList where ... 阅读全文
posted @ 2014-06-12 11:28 ®Geovin Du Dream Park™ 阅读(486) 评论(0) 推荐(0) 编辑
摘要:http://www.mssqltips.com/sqlservertip/1738/sql-server-udf-to-pad-a-string/declare @l varchar(50)set @l='3 'select @l=ltrim(rtrim('3'))select len(@l)SE... 阅读全文
posted @ 2014-05-16 12:46 ®Geovin Du Dream Park™ 阅读(547) 评论(0) 推荐(0) 编辑
摘要:--显示所有用户表:--1SELECT SCHEMA_NAME(schema_id) As SchemaName , name As TableName from sys.tables ORDER BY name--2。alternate:SELECT sch.name As Schem... 阅读全文
posted @ 2014-05-15 22:59 ®Geovin Du Dream Park™ 阅读(1146) 评论(0) 推荐(0) 编辑
摘要:--无法解决 equal to 操作中 "Chinese_PRC_CI_AS" 和 "Chinese_Taiwan_Stroke_CI_AS" 之间的排序规则冲突。CREATE VIEW View_VipBranchStaffBranchListASselect VipBranchStaff.*,geovindu_branch.B_Name,VipExamCountry.ExamCountryName from VipBranchStaff,geovindu_branch,VipExamCountry where VipBranchStaff.Branc 阅读全文
posted @ 2014-02-24 12:01 ®Geovin Du Dream Park™ 阅读(5765) 评论(0) 推荐(0) 编辑
摘要:T-SQL:declare @int int,@prov int,@city int,@str nvarchar(500)set @str='天河麗特青春:中國廣東省廣州市天河區天河路623號天河娛樂廣場麗特青春百貨一樓,塗聚文'select @int=charindex(':',@str) select @prov=charindex('省',@str) select @city=charindex('市',@str) select substring(@str,0,@int)select substring(@str,@int 阅读全文
posted @ 2014-02-21 15:13 ®Geovin Du Dream Park™ 阅读(736) 评论(0) 推荐(0) 编辑
摘要:---Example Uses of the SUBSTRING String Function--http://www.sql-server-helper.com/tips/tip-of-the-day.aspx?tkey=4AB06421-E859-4B5F-A948-0C9640F3108D&tkw=sample-uses-of-the-substring-string-function--取名字Usage #1 : Get the First Name and Last Name from a Full NameDECLARE @FullName VARCHAR(50) --s 阅读全文
posted @ 2014-01-21 12:09 ®Geovin Du Dream Park™ 阅读(399) 评论(0) 推荐(0) 编辑
摘要:DECLARE @birthday datetime,@stat datetime,@end datetime,@statbirthday datetime,@endbirthday datetime,@thirdbirthday datetime,@firthbirthday datetime, @year int,@month int , @day int,@str varchar(20),@total int,@firthmonth int,@thirmonth int,@now datetime,@vipno nvarchar(10) --参数set @vipno='88888 阅读全文
posted @ 2013-12-02 15:12 ®Geovin Du Dream Park™ 阅读(467) 评论(0) 推荐(0) 编辑
摘要:---2013年10月9日生日,就以2012年9月1日至2013年8月31日計算 (因為係生日月份前兩個月之最後一天為結算日)DECLARE @birthday datetime,@now datetime,@stat datetime,@end datetime,@statbirthday datetime,@endbirthday datetime,@thirdbirthday datetime,@firthbirthday datetime, @year int,@month int , @day int,@str varchar(20),@total decimalset @now.. 阅读全文
posted @ 2013-10-29 10:25 ®Geovin Du Dream Park™ 阅读(432) 评论(0) 推荐(0) 编辑

上一页 1 ··· 3 4 5 6 7
< 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
点击右上角即可分享
微信分享提示