if object_id('[tb]') is not null drop table [tb] go create table [tb](名稱 varchar(10),金額 int,標誌 varchar(2),日期 varchar(30))--收入1 支出為2 insert [tb] select 'a',100,'1','2009-11-23 13:45' union all select 'b',150,'2','2009-11-22 13:45' union all
create table [tb]([客戶編碼] varchar(10),[客戶名稱] varchar(10),[數量] int) insert [tb] select '001','A',2 union all select '001','A',3 union all select '001','A',4 union all select '002','B',1 union all select '002','B',2 --統計 select * from (select * from tb
--產生測試資料create table BOM(ID int,parentID int,sClassName varchar(10))insert into BOM values(1,0,'1111' )insert into BOM values(2,1,'1111_1' )insert into BOM values(3,2,'1111-1-1' )insert into BOM values(4,3,'1111-1-1-1') insert into BOM
-- 統計交叉相等兩列元祖的次數 去掉重複 if object_id('[tb]') is not null drop table [tb] go create table [tb]([num1] varchar(10),[num2] varchar(10)) insert [tb] select 'a','b' union all select 'b','c' union all select 'b','a' union all select 'c','b' union all
--列和相減 L3-L2declare @test table(L1 varchar(50),L2 int,L3 int)insert into @testselect 'A1',10,10 union allselect 'A1',10,5 union allselect 'A1',5,5 union allselect 'B1',10,20 union allselect 'B1',5,5 select * from @testselect a.*,b.L4 from @test a
--有小時、分鐘,求平均工作時間 declare @tb table([日期] varchar(3),[工作時間] varchar(5)) insert @tb select '1號','3:10' union all select '2號','3:20' union all select '3號','4:20' union all select '4號','4:30' select convert(varchar(5),dateadd(mi,avg(datediff(mi,0,工作時間))
CKEditor4.1+CKFinder2.3.1 FOR MVC4 最新破解版:(2013-3-23)baidu share: http://pan.baidu.com/share/link?shareid=410130&uk=2735096069CSDN:http://download.csdn.net/download/zengzhan/5172305CKEditor4.0.2+CKFinder2.3.1 FOR MVC4
今天用time Like '2008-06-01%'語句來查詢該天的所有資料,被提示句錯誤。查了一下才發現該模糊查詢只能用於String類型的欄位。自己也查閱了一些資料。關於時間的模糊查詢有以下三種方法: 1.Convert轉成String,在用Like查詢。select * from table1 where convert(varchar,date,120) like '2006-04-01%' 2.Betweenselect * from table1 where time