SQL
caicoi
这个作者很懒,什么都没留下…
展开
-
SELECT语句
SELECT语句SELECT * FROM table1 //最简单条件类型SELECT * FROM table1 WHERE cState = California //条件语句SELECT cName, vAddress, FROM table1 WHERE age > 8 //条件语句int类型SELECT Title, Ytd_Sales FROM Titles原创 2007-02-26 21:55:00 · 1259 阅读 · 0 评论 -
创建表
//自增加主键create table PLUS_SMS( s_id int IDENTITY(1,1) Primary Key, beginTime DateTime not null, endTime DateTime not null, senderCode varchar(20) not null, cpCode varchar(20) not null,原创 2007-04-27 12:20:00 · 486 阅读 · 0 评论 -
高级SQL语句
分页Select top {0} * from PLUS_SMS where (s_id not in (select top {1} s_id from PLUS_SMS order by s_id desc)) order by s_id desc -- {0}为页大小 由0开始,{1}为页码*页大小 返回最新IDselect IDENT_CURRENT(PLUS_SMS)--PL原创 2007-04-27 12:21:00 · 504 阅读 · 0 评论 -
存储过程
1.最简单的存储过程CREATE PROCEDURE dbo.spASSELECT * from ShoppingCartGO2.创建带参数的存储过程CREATE PROCEDURE dbo.spShoppingCartUpdateQty( @CartID VARCHAR(50), @ProductID INT, @Quantity INT)ASUPDATE Sh原创 2007-04-27 12:20:00 · 578 阅读 · 0 评论