2010年11月24日

摘要: ALTER TABLE order_sampleADD CONSTRAINT [FK__order_sam__cust___0425A276] FOREIGN KEY(cust_id) REFERENCES cuts_sample(cust_id) alter table dbo.WaterWatch add constraint Watch foreign key(WatchDataID)ref... 阅读全文
posted @ 2010-11-24 12:33 烈日轨迹 阅读(221) 评论(0) 推荐(0) 编辑
 
摘要: 第一种方法:第二种方法:int a=55; //a可正可负int result=a>0 ? a:(-1*a);输出结果是绝对值 阅读全文
posted @ 2010-11-24 10:50 烈日轨迹 阅读(10866) 评论(2) 推荐(1) 编辑
 
摘要: 表的例子结构:tbltest4:id 23 1 2 3 4 5 6 7 8 9 55 761、选取最大的数select max(id) from tbltest42、选取最大的三个数select top 3 * from tbltest4 order by id desc3、选取第2大的数select top 1 a.* from (select top 2 * from tbltest4 ord... 阅读全文
posted @ 2010-11-24 09:09 烈日轨迹 阅读(1584) 评论(0) 推荐(0) 编辑