`
yacole
  • 浏览: 241118 次
  • 性别: Icon_minigender_1
  • 来自: 浙江科技学院
社区版块
存档分类
最新评论
文章列表
SELECT TOP 1 mobile FROM mobile ORDER BY NEWID()

group by

select max(len(area)) tt,area from mobile group by area order by tt desc
select @area = area from mobile where mobile = left(@MobileNum,7)  -----取到省份   if @area is null  set @area = 'kuka'
create table #CountNum (  [id] [int] IDENTITY (1, 1) NOT NULL ,  [succ] [int],  [tt] [int],  [area] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,  CONSTRAINT [PK_#CountNum] PRIMARY KEY  CLUSTERED  (   [id]  )  ON [PRIMARY] ) ---临时表 select * from #CountNum insert into #CountNum  (succ,tt,area) ...
用turncate table table1 因为truncate 是DDL操作,不产生rollback,不写日志速度快一些,然后如果有自增的话,恢复到1开始 而delete会产生rollback,如果删除大数据量的表速度会很慢,同时会占用很多的rollback segments, 同时还要记录下G级别的日志 1.选出您所需要保留的记录到新的表 Select * into Table2 From Table1 Where Time>='2006-03-10' 2.然后直接Truncate table Table1。无论何种恢复模式都不会进行日志记录 Truncate table ...
CREATE procedure [dbo].[f_bak_job]   as declare @filename nvarchar(100) set @filename='H:\db_60_bak\5298SP_backup_'+rtrim(convert(char(10),getdate(),112))+'.bak' --print @filename BACKUP DATABASE [5298SP] TO DISK = @filename WITH NOINIT , NOUNLOAD , NAME = N'备份', NOSKIP , STATS = 10, NOFORMAT
CREATE  proc GetThePage @pagesize int, @pageindex int, @col nvarchar(100), @tb nvarchar(20), @wherestr nvarchar(100), @sOrder varchar(10), @sOrdStr nvarchar(20) AS --@pagesize 分页设置大小 --@pageindex 当前页面索引值 --@col 列名  'a,b,c...' --@tb 表名 --@wherestr  'where 1=1 and .....'条件语句 --@sOrder //'asc' 或者 'desc ...
SET QUOTED_IDENTIFIER ON GO SET ANSI_NULLS ON GO CREATE   procedure main_table_sdiv ( @pagesize int, @pageindex int, @docount bit, @TableName varchar(20), @Col varchar(500), @sTableName varchar(20), @whereStr varchar(100) ) as declare @SqlStr    varchar(1000) if(@docount=1) begin ...
www.w3pop.com/sucai/regular_expression/regular_expression.htm
www.w3pop.com/sucai/css2/css2.html
package QueryBean; import java.io.PrintStream; public class codetostr {     public codetostr()     {     }     public String codeToString(String str)     {         String s = str;         try         {             byte tempB[] = s.getBytes("ISO-8859-1");             s = new String(tempB);   ...
package QueryBean; public class dataPage {   private int currentPage;//当前页数   private int countRecord;//总记录条数   private int countPage;//总页数   private int sizePage;//每页记录条数   public void setAll(int _countRecord,int _sizePage)   //设置四个成员变量的值   {    countRecord=_countRecord;    sizePage=_sizePage;    if ...
package QueryBean; import java.sql.*; public class myjdbc {   Connection conn;      ResultSet rs;      public myjdbc()      {          rs = null;          try          {              Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver" ...
一个用于处理日期,数字和文本格式的“帮助方法”。 <%= distance_of_time_in_words(Time.now, Time.local(2005, 12, 25)) %> 248 days <%= distance_of_time_in_words(Time.now, Time.now + 33, false) %> 1 minute <%= distance_of_time_in_words(Time.now, Time.now + 33, true) %> half a minute <%= time_ago_in_words(Tim ...
SQL Server 存储过程的分页,这个问题已经讨论过几年了,很多朋友在问我,所以在此发表一下我的观点 建立表: CREATE TABLE [TestTable] (  [ID] [int] IDENTITY (1, 1) NOT NULL ,  [FirstName] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,  [LastName] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,  [Country] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS ...
Global site tag (gtag.js) - Google Analytics