摘要:
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
莫水千流
阅读(258)
评论(0)
推荐(0)
摘要:
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
莫水千流
阅读(463)
评论(1)
推荐(0)
摘要:
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
莫水千流
阅读(1318)
评论(1)
推荐(0)
摘要:
最近在讲到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
莫水千流
阅读(1048)
评论(0)
推荐(0)
摘要:
一、基本的SELECT语句 1. “*”的注意事项:在SELECT语句中,用*来选取所有的列,这是一个应该抵制的习惯。 虽然节省了输入列名的时间,但是也意味着获得的数据比真正需要的数据多的多。相应的,也会降低应用程序的性能及网络性能。 良好的规则是只选所需。 2. join子句 join是用来定义如何从多个表中选取数据并组合成一个结果集。 join必需是因为(1)我们所要获取的所有信息并不都在一个表中,或者(2)所要返回的信息都在一个表中,但是其上设置的条件信息却在另一个表中。 join的共同点是通过记录的连接列,把一条记录同一条或者多条其他记录进行匹配,从而产生出是这些记录的超级的记... 阅读全文
posted @ 2013-09-18 08:48
莫水千流
阅读(1220)
评论(0)
推荐(0)