3 Specifying Rows.

Slides:



Advertisements
Similar presentations
11 Chapter 3: Displaying Query Results 3.1 Presenting Data 3.2 Summarizing Data.
Advertisements

CSEN 5314 Quiz What type of join is needed when you wish to include rows that do not have matching values? A. Equi-joinB. Natural join C. Outer.
Introduction to Oracle9i: SQL1 Basic SQL SELECT Statements.
Introduction to Oracle9i: SQL1 SQL Group Functions.
WRITING BASIC SQL SELECT STATEMENTS Lecture 7 1. Outlines  SQL SELECT statement  Capabilities of SELECT statements  Basic SELECT statement  Selecting.
Chapter 2 Basic SQL SELECT Statements
 SQL stands for Structured Query Language.  SQL lets you access and manipulate databases.  SQL is an ANSI (American National Standards Institute) standard.
11 Chapter 2: Basic Queries 2.1: Overview of the SQL Procedure 2.2: Specifying Columns 2.3: Specifying Rows.
Creating and Managing Indexes Using Proc SQL Chapter 6 1.
SQL Chapter Two. Overview Basic Structure Verifying Statements Specifying Columns Specifying Rows.
4a. Structured Query Language - SELECT Statement Lingma Acheson Department of Computer and Information Science IUPUI CSCI N207 Data Analysis with Spreadsheets.
SQL Basics. What is SQL? SQL stands for Structured Query Language. SQL lets you access and manipulate databases.
DATA RETRIEVAL WITH SQL Goal: To issue a database query using the SELECT command.
Performing Advanced Queries Using PROC SQL Chapter 2 1.
SAUSAG 69 – 20 Feb 2014 Smarter Sorts Jerry Le Breton (Softscape Solutions) & Doug Lean (DHS) Beyond the Obvious.
1 Copyright © Oracle Corporation, All rights reserved. Writing Basic SQL SELECT Statements.
Chapter 4: Combining Tables Vertically using PROC SQL 1 © Spring 2012 Imelda Go, John Grego, Jennifer Lasecki and the University of South Carolina.
7 1 Database Systems: Design, Implementation, & Management, 7 th Edition, Rob & Coronel 7.6 Advanced Select Queries SQL provides useful functions that.
Simple Queries DBS301 – Week 1. Objectives Basic SELECT statement Computed columns Aliases Concatenation operator Use of DISTINCT to eliminate duplicates.
1 SQL Chapter 9 – 8 th edition With help from Chapter 2 – 10 th edition.
Writing Basic SQL SELECT Statements Lecture
1 Structured Query Language (SQL) Pertemuan 09 Matakuliah: F0712 / Lab MS Access Tahun: 2007.
1 SQL: The Query Language. 2 Example Instances R1 S1 S2 v We will use these instances of the Sailors and Reserves relations in our examples.
Dept. of Computer & Information Sciences
SQL (Structured Query Language)
Session 1 Retrieving Data From a Single Table
CHAPTER 7 DATABASE ACCESS THROUGH WEB
Chapter 6: Set Operators
Using the Set Operators
Database Management  .
Basic Queries Specifying Columns
PROC SQL, Overview.
Writing Basic SQL SELECT Statements
Using the Set Operators
Noncorrelated subquery
Correlated Subqueries
Aggregating Data Using Group Functions
A more complex example.
Integrity Constraints
Displaying Queries 2 Display a query’s results in a specified order.
Subsetting Rows with the WHERE clause
Outer Joins Inner joins returned only matching rows. When you join tables, you might want to include nonmatching rows as well as matching rows.
Chapter 4 Summary Query.
Chapter 7 Most important: 7.2
Grouping Summary Results
Access: SQL Participation Project
Databases and Information Management
Program Testing and Performance
مديريت موثر جلسات Running a Meeting that Works
Summarizing Data with Summary Functions
Writing Basic SQL SELECT Statements
5 The EXCEPT Operator Unique rows from the first result set that are not found in the second result set are selected.
Access/SQL Server Eliminate Duplicates with SELECT DISTINCT
Combining (with SQL) HRP223 – 2012 November 05, 2011
The INTERSECT Operator
Presenter’s Name and Title Department Date of Presentation
Lesson 3 Chapter 10.
Using SQL*Plus.
Creating Tables Create a new table by defining the column structure.
3 Views.
Introduction to Subqueries, An Example
A new keyword -- calculated
Subqueries.
Lab 7: Filtering.
Topic 12 Lesson 2 – Retrieving Data with Queries
SQL set operators and modifiers.
UNION Operator keywords Displays all rows from both the tables
Remerging Summary Values
Using the Set Operators
Level 1 +3SD +2SD +1SD Mean -1SD -2SD -3SD Level 2.
Presentation transcript:

3 Specifying Rows

orion.Employee_Organization proc contents data=orion.Employee_Organization position; run;

Display the names of the Orion Star departments proc sql; select Department from orion.Employee_Organization ; quit; s102d11

The distinct and unique keywords

Eliminating Duplicate Rows, the Distinct keyword proc sql; select distinct Department from orion.Employee_Organization ; quit; s102d11

The unique keyword proc sql; select unique department from orion.Employee_Organization ; quit; Although the UNIQUE argument is identical to DISTINCT, it is not an ANSI standard.