SQL UNION
摘要:QL UNION is query that allows you to select related information from 2 tables, this is combine 2 SELECT statement into 1 and display it out.UNION will only return DISTINCT value only. Which means will eliminate duplicate records that returned.There are some condition that need to meet when using the
阅读全文
posted @
2013-09-18 09:03
莫水千流
阅读(190)
推荐(0) 编辑
SQL UNION ALL
摘要:QL UNION ALL is query that allows you to select related information from 2 tables, the result is different from the UNION statement. It return all the record from SELECT statement that used.UNION ALL selects all rows from each table and combines them into a single table.The syntax is as follows:SELE
阅读全文
posted @
2013-09-18 09:03
莫水千流
阅读(222)
推荐(0) 编辑
SQL SELECT INTO
摘要:The SELECT INTO statement is usually used to create backup copies of tables. That also explain that SELECT INTO creates a new table and fills it with data computed by a query.SELECT INTO syntax is:SELECT [COLUMN NAME 1], [COLUMN NAME 2] ,... INTO [BACKUP TABLE NAME] FROM[TABLE NAME] EXAMPLE 1 ...
阅读全文
posted @
2013-09-18 09:02
莫水千流
阅读(247)
推荐(0) 编辑
SQL JOIN
摘要:A JOIN command is queries that combine data from more than 1 table.For two tables that want to join together need to have some data in common, like unique id that link this 2 tables together. Normal join will need a joining condition or connecting column to display out the joined data. 1 joining con
阅读全文
posted @
2013-09-18 09:00
莫水千流
阅读(247)
推荐(0) 编辑
SQL INNER JOIN
摘要:A INNER JOIN command is queries that combine data from more than 1 table.For two tables that want to join together need to have some data in common, like unique id that link this 2 tables together. INNER JOIN will need a joining condition or connecting column to display out the joined data. 1 joinin
阅读全文
posted @
2013-09-18 09:00
莫水千流
阅读(459)
推荐(0) 编辑
SQL OUTER JOIN
摘要:When we want to select out all the record from two table, no matter it's present at second table or not, we will have to use SQL OUTER JOIN command.There are 3 type of OUTER JOIN, which is: LEFT OUTER JOIN RIGHT OUTER JOIN FULL OUTER JOINSQL OUTER JOIN syntax:SELECT * FROM [TABLE 1] OUTE...
阅读全文
posted @
2013-09-18 08:55
莫水千流
阅读(1311)
推荐(0) 编辑
SQL CROSS JOIN
摘要:最近在讲到T-SQL查询的Join部分时,一下子没有想起来CROSS JOIN的用法,因为其实平常也确实基本不用到。特意找了一个例子,以供参考CROSS JOIN又称为笛卡尔乘积,实际上是把两个表乘起来。以下资料摘自:http://www.sqlguides.com/sql_cross_join.phpSQL CROSS JOIN will return all records where each row from the first table is combined with each row from the second table. Which also mean CROSS JO
阅读全文
posted @
2013-09-18 08:53
莫水千流
阅读(1028)
推荐(0) 编辑
SQL 基础:Select语句,各种join,union用法
摘要:一、基本的SELECT语句 1. “*”的注意事项:在SELECT语句中,用*来选取所有的列,这是一个应该抵制的习惯。 虽然节省了输入列名的时间,但是也意味着获得的数据比真正需要的数据多的多。相应的,也会降低应用程序的性能及网络性能。 良好的规则是只选所需。 2. join子句 join是用来定义如何从多个表中选取数据并组合成一个结果集。 join必需是因为(1)我们所要获取的所有信息并不都在一个表中,或者(2)所要返回的信息都在一个表中,但是其上设置的条件信息却在另一个表中。 join的共同点是通过记录的连接列,把一条记录同一条或者多条其他记录进行匹配,从而产生出是这些记录的超级的记...
阅读全文
posted @
2013-09-18 08:48
莫水千流
阅读(1188)
推荐(0) 编辑
sql 语言
摘要:表3.1 SQL语言的动词SQL 功 能动 词数 据 查 询SELECT 数 据 定 义CREATE,DROP,ALTER数 据 操 纵INSERT,UPDATEDELETE数 据 控 制GRANT,REVOKE基本表的定义、删除与修改一、定义基本表CREATE TABLE ( [ ] [, [ ] ] … [, ] ); 如果完整性约束条件涉及到该表的多个属性列,则必须定义在表级上,否则既可以定义在列级也可以定义在表级。学生表Student建立“学生”表Student,学号是主码,姓名取值唯一。 CREATE TABLE Student (Sno CHAR(9) PRIMARY KEY...
阅读全文
posted @
2013-09-13 23:20
莫水千流
阅读(1207)
推荐(0) 编辑
sqllite3
摘要:OS X自从10.4后把SQLite这套相当出名的数据库软件,放进了作业系统工具集里。OS X包装的是第三版的SQLite,又称SQLite3。这套软件有几个特色: 软件属于公共财(public domain),SQLite可说是某种「美德软件」(virtueware),作者本人放弃着作权,而给使用SQLite的人以下的「祝福」(blessing): May you do good and not evil. 愿你行善莫行恶 May you find forgiveness for yourself and forgive others. 愿你原谅自己宽恕他人 May ...
阅读全文
posted @
2013-09-13 21:19
莫水千流
阅读(511)
推荐(0) 编辑
输入法核心数据结构及算法的设计
摘要:问题的关键在于如何做到智能输入提示呢?由于很多单词是共享前缀的,才使得用户输入过程中,智能地提示可供选择的词组。因此,创建共享前缀树用于存储单词词条,并在用户输入过程中实时地查寻前缀相同的词条是一个非常好的思路。如果你学过数据结构的话,就知道这种结构叫“键树”。输入法只需要实现三个非常重要的函数即可:[java]view plaincopy/***插入一个单词**@paramterm*要插入的单词*/publicvoidinsert(Stringterm);/***删除一个单词**@paramterm*要删除的单词*/publicvoiddelete(Stringterm);/***获取提示的
阅读全文
posted @
2013-09-13 20:53
莫水千流
阅读(2762)
推荐(0) 编辑