欢迎访问我的独立博客
摘要: 语法:UPDATE 表 SET 列 = 新值 WHERE 列名 = 某值Person:LastNameFirstNameAddressCityGatesBillXuanwumen 10BeijingWilsonChamps-Elysees例:更新某一行中的一个列我们为Lastname 是 "Wilson" 的人添加 firstname:UPDATE Person SET FirstName = 'Fred' WHERE LastName = 'Wilson'结果:LastNameFirstNameAddressCityGatesBillXua 阅读全文
posted @ 2012-11-06 18:54 github.com/starRTC 阅读(358) 评论(0) 推荐(0)
摘要: 语法INSERT INTO 表 VALUES (值1, 值2,....)也可以指定要插入数据的列:INSERT INTO表(列1, 列2,...) VALUES (值1, 值2,....)例:插入新的行"Persons" 表:LastNameFirstNameAddressCityCarterThomasChangan StreetBeijingSQL 语句:INSERT INTO Persons VALUES ('Gates', 'Bill', 'Xuanwumen 10', 'Beijing')结果:Las 阅读全文
posted @ 2012-11-06 18:47 github.com/starRTC 阅读(254) 评论(0) 推荐(0)
摘要: 默认为升序,如果希望按降序对记录进行排序,可使用 DESC 关键字。Orders 表:CompanyOrderNumberIBM3532W3School2356Apple4698W3School6953例 1以字母顺序显示公司名称:SELECT Company, OrderNumber FROM Orders ORDER BY Company结果:CompanyOrderNumberApple4698IBM3532W3School6953W3School2356例 2以字母顺序显示公司名称(Company),并以数字顺序显示OrderNumber:SELECT Company, OrderNu 阅读全文
posted @ 2012-11-06 18:38 github.com/starRTC 阅读(330) 评论(0) 推荐(0)
摘要: AND 和 OR 可在 WHERE 子句中把两个或多个条件结合起来。表:LastNameFirstNameAddressCityAdamsJohnOxford StreetLondonBushGeorgeFifth AvenueNew YorkCarterThomasChangan StreetBeijingCarterWilliamXuanwumen 10BeijingAND实例使用 AND 来显示所有 姓为 "Carter" 并且名为 "Thomas" 的人:SELECT * FROM Persons WHERE FirstName='Tho 阅读全文
posted @ 2012-11-06 10:53 github.com/starRTC 阅读(396) 评论(0) 推荐(0)
摘要: 智能指针,stl中有auto_ptr,boost的smart_ptr库有6种:scoped_ptr,scoped_array,shared_ptr,shared_array,weak_ptr和intrusive_ptr.scoped_ptr的拷贝构造函数和赋值操作符声明为私有,以禁止对智能指针的复制。例1:#include <boost/smart_ptr.hpp>#include <iostream>#include <string>using namespace std;using namespace boost;int main(){ scoped_p 阅读全文
posted @ 2012-11-06 08:43 github.com/starRTC 阅读(248) 评论(0) 推荐(0)
摘要: timer库(含timer,progress_timer和progress_display三个组件)和date_timetimer用法:#include <boost/timer.hpp>#include <iostream>using namespace std;using namespace boost;int main(){ timer t;//开始计时 cout<<"max timespan:"<<t.elapsed_max()/3600<<"h"<<endl; cout&l 阅读全文
posted @ 2012-11-06 08:37 github.com/starRTC 阅读(187) 评论(0) 推荐(0)
摘要: STLPort是C++标准库的一个高效实现具有高度的可移植性,最新版本是5.21版,先下载“STLport-5.2.1.tar.bz2”,解压到D:\develop\STLport-5.2.1使用时要先编译:1,从开始菜单运行vs2005的命令行提示工具“Visual Studio 2005 Command Prompt”;2,cd进入D:\develop\STLport-5.2.1目录;3,执行”configure msvc8”(vc6使用msvc6,vc9即vs2008使用msvc9)4,执行”cd D:\develop\STLport-5.2.1\build\lib”5,执行”nmake 阅读全文
posted @ 2012-11-06 08:31 github.com/starRTC 阅读(927) 评论(0) 推荐(0)
摘要: 1,微软实现C:\Program Files\Microsoft Visual Studio 10.0\VC\crt\src\strcat.cchar * strcpy(char * dst, const char * src){ char * cp = dst; while( *cp++ = *src++ ) ; /* Copy src over dst */ return( dst );}2,林锐《高质量C++/C编程指南》#include <assert.h>char *strcpy(ch... 阅读全文
posted @ 2012-11-05 21:29 github.com/starRTC 阅读(1929) 评论(0) 推荐(0)
摘要: 通配符可以替代一个或多个字符。通配符必须与 LIKE 运算符一起使用。在 SQL 中,可使用以下通配符:通配符描述%替代一个或多个字符_仅替代一个字符[charlist]字符列中的任何单一字符[^charlist]或者[!charlist]不在字符列中的任何单一字符Persons 表:IdLastNameFirstNameAddressCity1AdamsJohnOxford StreetLondon2BushGeorgeFifth AvenueNew York3CarterThomasChangan StreetBeijing使用 % 通配符例 1如果我们希望从上面的表中选取居住在以 &qu 阅读全文
posted @ 2012-11-05 21:01 github.com/starRTC 阅读(352) 评论(0) 推荐(0)
摘要: 如果需要有条件地从表中选取数据,可将 WHERE 子句添加到 SELECT 语句中。语法SELECT 列 FROM 表 WHERE 列 运算符 值下面的运算符可在 WHERE 子句中使用:操作符描述=等于<>不等于>大于<小于>=大于等于<=小于等于BETWEEN在某个范围内注:在某些数据库系统中,操作符 <> 也可以写为 !="Persons" 表LastNameFirstNameAddressCityYearAdamsJohnOxford StreetLondon1970BushGeorgeFifth AvenueNew 阅读全文
posted @ 2012-11-05 20:53 github.com/starRTC 阅读(357) 评论(0) 推荐(0)