Access 2007 SQL the default value for switch

I am using switch statement in access 2007, i want to know how I can specify default value. select switch ( MyCol = 1, ‘Value is One’, MyCol = 2, ‘Value is Two’ ) from MyTable -> SELECT Switch(MyTable.[MyCol]=’1′,’Terrestrial’, MyTable.[MyCol]=’2′,’Value is two’,MyTable.[MyCol]=’3′,’Value is three’, True,’Error’) AS ColumnName FROM MyTable; […]

Read More…

关于SQLITE的加密

1)http://wenku.baidu.com/view/e3adf5707fd5360cba1adb0b.html 这篇文章,2)以及 http://sourceforge.net/projects/wxsqlite/ 源码提供者!3)还有,强烈推荐下 《sqlite加密设计的缺陷与改进》 里面提到的问题本人没有重视,还请大家努力。  http://www.eoeandroid.com/forum.php?mod=viewthread&tid=180140 Other: 1)http://blog.csdn.net/bigdavidwli007/article/details/7091866 2)http://sqlcipher.net/about/ […]

Read More…

sql server 2008 sa账户无法登录,错误:233

http://hi.baidu.com/cive/blog/item/bd4e8e82a714d0b26c81198d.html 重新安装了sql server 2008,发现sa账户无法登录,错误是233。 网上找了很多帖子, 设置了“SQL   Server和Windows身份验证模式”, 也设置了sa“启用”, 也重启了N次, 都不行, 偶然看到一个办法,一试就好了。 如下:   用Windows身份验证登录,执行SQL命令: ALTER LOGIN sa WITH PASSWORD=’新密码’, 搞定,现在终于可以用sa登录SQL管理器了。 […]

Read More…

Recursive Relationships

Recursive relationships: relationships exist between entity instances of the same type. One-to-one: If we were to track which employees were married to other employees, we would expect each to be married to either zero or one other employee at any one point in time. One-to-many: It is common to track the employment “food chain” of  […]

Read More…

About Count

select count(*) FROM [AdventureWorks].[Person].[Contact] 返回表中所有的记录的个数 select COUNT(MiddleName) from [AdventureWorks].[Person].[Contact] 返回字段中,值非空的记录的个数(重复的也算进去的)  select COUNT(distinct MiddleName) from [AdventureWorks].[Person].[Contact] 返回字段中不重复且非空的记录的个数 Result: 19972 11473 70 […]

Read More…

Cursors in SQL

SQL was designed as a set-oriented processing language. Some business rules( or poor physical design) require performing actions on row-by-row basis. Consider the following example: . Increase the price of books <=$15 by 15% . Decrease the price of books > $15 by 10% Here is a set-oriented solution: update titles set price = price […]

Read More…