1.select sum(CASE WHEN A.[STATUS]=0 THEN 1 ELSE
0 end) as a1,sum(CASE A.[STATUS] WHEN 1 THEN 1 ELSE 0 end) as a2,sum(CASE
A.[STATUS] WHEN 2 THEN 1 ELS...
分类:
数据库 时间:
2014-06-04 21:10:46
阅读次数:
513
简单深搜,可以完全暴力,不会超时的。#include#include#includeusing
namespace std;#define MAX(a,b) (a>b?a:b) char maze[10][10];int n, maxn;void
DFS(int step,int count);in...
分类:
Web程序 时间:
2014-06-04 20:43:04
阅读次数:
270
NHibernate这个框架用了有一年多了,相对有很大的优势,可以省去很多写Sql的时间。但是如果你想用它做统计,那么有点抱歉,只能手动写写了。它内置的东西很难符合你的需求。我遇到的问题是这样的。我需要统计一个表中根据一个字段分组统计这个每个组的数量。这个Sql很简单表名要用对象名替换,字段也要用对...
分类:
系统相关 时间:
2014-06-04 19:26:21
阅读次数:
315
做法1: List list = new List(); Random rand = new
Random(); while (list.Count =1,=0,<100 之间的随机数m、n,颠倒arr[m]和arr[n]的数。 int[] arr
= new int[100]; //把100个数顺...
分类:
其他好文 时间:
2014-05-30 04:27:12
阅读次数:
208
本文希望通过简单的总结,把常用的查询方法予以总结,希望能够明确在心主要涵盖:模糊查询、排序、分组、集合函数、TOP、Case包括:Between、In、Like、And、Or、Order
by包括:Group by、Distinct、MAX\MIN、Avg、Count、Sum、Having、Top、...
分类:
数据库 时间:
2014-05-29 23:13:46
阅读次数:
456
sql server 全部库:declare @i int,@id int,@dbname
varchar(255),@sql varchar(255) set @i = 6 set @id=(select count(*) from
master..sysdatabases)drop ...
分类:
数据库 时间:
2014-05-29 22:15:06
阅读次数:
310
http://blog.chinaunix.net/uid-23577393-id-1751983.htmlTo
count how often any pattern occurs in the current buffer use the
substitutecommand and add th...
分类:
其他好文 时间:
2014-05-29 17:37:03
阅读次数:
217
本篇文章介绍下redis排序命令.redis支持对list,set和sorted
set元素的排序。排序命令是sort 完整的命令格式如下:SORT key [BY pattern] [LIMIT start count] [GET
pattern] [ASC|DESC] [ALPHA] [STOR...
分类:
其他好文 时间:
2014-05-29 09:02:28
阅读次数:
318
BsCapters::model()->findAllBySql("select
count(*) as bookids from bs_capters where bookid = ".$bookid." and urlid =
".$urlid)count(*) as xxx这个xxx必须是表里...
分类:
其他好文 时间:
2014-05-28 11:32:16
阅读次数:
275
–-表现最差的前10名使用查询SELECT TOP 10 ProcedureName =
t.text, ExecutionCount = s.execution_count, AvgExecutionTime = isnull (
s.total_elapsed_time / s.executio...
分类:
数据库 时间:
2014-05-28 11:25:22
阅读次数:
449