首先定义一个简单类,并重写ToString方法。public class CommidityFilter { public string Property { get; set; } public string Characterist { get; set; } ...
分类:
其他好文 时间:
2014-12-31 18:16:49
阅读次数:
214
分类统计使用比较多,一般用于统计某项的个数或某项下的项数有多少。简单的,比如一张表tab_testtab_test记录idconamejob1IBMJACKPM2GoogleTOMPM3IBMJIMPM想统计这样的结果:co:人数。sql如下:select distinct t.co,count(t.name)
from tab_test t
group by t.co;结果co ...
分类:
数据库 时间:
2014-12-30 20:45:35
阅读次数:
205
1、问题描述:1 select FName from teacher 2 where FId not in(3 select distinct FTeacherId from student4 )子查询返回的结果集中包含NULL,导致整条查询语句执行失败。2、原因:当和NULL比较...
分类:
其他好文 时间:
2014-12-30 18:41:20
阅读次数:
204
sql 单表/多表查询去除重复记录单表distinct多表group bygroup by 必须放在 order by 和 limit之前,不然会报错***************************************************************************...
分类:
数据库 时间:
2014-12-30 17:00:57
阅读次数:
207
在表中,可能会包含重复值。这并不成问题,不过,有时您也许希望仅仅列出不同(distinct)的值。关键词 distinct用于返回唯一不同的值。表A:示例1select distinct name from A执行后结果如下:示例2select distinct name, id from A执行后...
分类:
数据库 时间:
2014-12-30 10:03:24
阅读次数:
184
MySQL聚合函数常用的有五个SUMCOUNTAVGMIN/MAXAVG([DISTINCT]expr)返回expr的平均值。DISTINCT选项可用于返回expr的不同值的平均值。SELECTgender,AVG(age)FROMstudentGROUPBYgender;COUNT(expr)返回SELECT语句检索到的行中非NULL值的数目。SELECTCOUNT(*)FROMstudent;--返回检..
分类:
数据库 时间:
2014-12-30 01:50:00
阅读次数:
281
SubsetsGiven a set of distinct integers,S, return all possible subsets.Note:Elements in a subset must be in non-descending order.The solution set must...
分类:
其他好文 时间:
2014-12-29 22:52:49
阅读次数:
198
Given a sequence of integers, find the longest increasing subsequence (LIS).You code should return the length of the LIS.ExampleFor [5, 4, 1, 2, 3], t...
分类:
其他好文 时间:
2014-12-29 06:31:53
阅读次数:
131
Longest Substring with At Most Two Distinct CharactersGiven a string, find the length of the longest substring T that contains at most 2 distinct char...
分类:
其他好文 时间:
2014-12-28 16:53:21
阅读次数:
198
找到最多含有两个不同字符的子串的最长长度。例如:eoeabc,最长的是eoe为3,其他都为2.思路:用p1,p2表示两种字符串的最后一个出现的下标位置。初始p1为0. p2为-1.start初始化为0,表示两种字符串的开头。只要遍历一次string就可以得到结果了。首先我们要确定p2的值,那么i要一...
分类:
其他好文 时间:
2014-12-25 21:47:44
阅读次数:
150