摘要: Applying Additional Condtions to a JoinUse the AND cluause or the WHERE clause to aplly additional condtions:AND CLAUSESQL> SELECT e.employee_id,e.last_name,d.department_id,d.department_name FROM employees e JOIN departments d ON (e.department_id = d.department_id) AND e.manager_id = 149;EMPLOYEE 阅读全文
posted @ 2013-04-15 17:23 ArcerZhang 阅读(165) 评论(0) 推荐(0) 编辑
摘要: Creating Natural JoinsThe NATURAL JOIN clause is based on all columns in the two tables that have the same name.It selects rows from the two tables that have equal values in all matched columns.If the columns having the same names have different data types,an error is returned.Retrieving Records wit 阅读全文
posted @ 2013-04-15 15:38 ArcerZhang 阅读(161) 评论(0) 推荐(0) 编辑
摘要: ObjectivesAfter completing this lesson,you should be able to do the following:Write SELECT statements to access data from more than one table using equijoins and nonequijoins.Join a table to itself by using a self-joinView data that generally does not meet a join condtions by using outer joinsGenera 阅读全文
posted @ 2013-04-15 15:37 ArcerZhang 阅读(188) 评论(0) 推荐(0) 编辑
摘要: Using the GROUP BY ClauseThe GROUP BY column does not have to be in the SELECT list.(不过这样一般意义不大)View Code SQL> SELECT AVG(salary) AvgSalary FROM employees GROUP BY department_id ORDER BY AVGSALARY; AVGSALARY----------3475.55556 4150 4400 5760 6500 70008601.333338955.88235 ... 阅读全文
posted @ 2013-04-15 12:28 ArcerZhang 阅读(210) 评论(0) 推荐(0) 编辑
摘要: ObjectivesAfter completing this lesson,you should be able to do the following:Identify the available group functionsDescribe the use of group functionsGroup data by using the GROUP BY clauseInclude or exclude grouped rows by using the HAVING clauseLesson AgendaGroups functions:-Types and syntax-Use 阅读全文
posted @ 2013-04-15 10:39 ArcerZhang 阅读(260) 评论(1) 推荐(0) 编辑