测试表:studentselect * from studnet; select count(distinct name) from student;select count(distinct *) from student;
这样是有错误的,可以变通的实现select count(*) from
...
分类:
数据库 时间:
2014-12-11 17:12:12
阅读次数:
158
在上篇博文mongodb已经成功启动,接下来就该进行一系列操作了。我们再开一个cmd,输入【mongo】命令打开shell即mongodb的客户端,默认连接的是“test”数据库,我这里设置集合(表)为student。图一:
1. 添加insert
语法:db.集合.insert({“Col1”:”列值1”,”Col2”:”列值2”,…,”Coln”:”列值n”})...
分类:
数据库 时间:
2014-12-11 14:01:35
阅读次数:
204
题目一:输入一个英文句子,翻转句子中单词的顺序。但是单词内字符的顺序不变。为简单起见,标点符号和普通字母一样处理。例如输入字符串“Iamastudent.”,则输出"student.aamI"。分析:经典题目。先将整句翻转,再将每个单词翻转就可以了。实现如下:voidReverse(char*pBegin..
分类:
其他好文 时间:
2014-12-10 02:01:49
阅读次数:
207
1. 设计一个Person类,它有两个派生类Student和Employee,Employee有两个派生类Faculty和Staff。?Person类有一个string类型的名字name,string型的身份号id,string型的电话号码phonenumber, Person类构造函数的对应nam...
分类:
编程语言 时间:
2014-12-10 00:29:30
阅读次数:
291
自我总结,欢迎拍砖!目的:定义int(3)和int(10)真的有区别吗?分别定义一个student,student2表 create table student(id int(5) not null primary key,name varchar(20)); create table stud.....
分类:
数据库 时间:
2014-12-09 19:12:46
阅读次数:
190
本文转自:http://www.cnblogs.com/songxingzhu/p/3816309.html直接进入主题:class Student { public int age { get; set; } public DateTime? date { get...
分类:
编程语言 时间:
2014-12-09 17:30:08
阅读次数:
346
在阅读廖雪峰的Python的笔记时,读到了@property特性,发现略有不足,由于自己是初学,希望惠及更多的初学者吧。
@property 的用途是什么呢?
下面一步一步地介绍。
定义类Student,拥有变量名name和score
1234
class Student(object): def __init__(self,name,score):...
分类:
编程语言 时间:
2014-12-08 23:08:15
阅读次数:
325
DescriptionThe Saratov State University Olympiad Programmers Training Center (SSU OPTC) hasnstudents. For each student you know the number of times he...
分类:
其他好文 时间:
2014-12-08 22:49:04
阅读次数:
274
1.对象向上转型 向上转型:将子类的对象赋值给父类的引用 eg:Student s=new Student(); Person p=s; 也是多态的表现,引用与对象可以是不同的类型。父类引用指向子类的对象。 另外,引用类型可以是实际对象类的父类。 p只能调用Person的方法和Student继承后的...
分类:
其他好文 时间:
2014-12-08 17:24:11
阅读次数:
202
Code First 代码优先。上代码:新建你需要的数据模型(也可以认为是你需要的数据表):namespace CodeFirstDemo.Models{ public class Student { public int Id { get; set; } p...
分类:
Web程序 时间:
2014-12-07 17:41:37
阅读次数:
224