DATETIME SELECT SELECT INTO DATE PAD STRING DYNAMIC SQL CURSOR MONEY FORMAT PERCENT STORED PROCEDURE SQL SERVER AGENT JOB OPTIMIZATION WHILE LOOP OVER PARTITION BY UPDATE
 
 
SITE SEARCH SQLUSA.com VIDEOS
 
 
SQL E/BOOKS   WORLD, USA & SQL NEWS   FORMAT
SCRIPTS SQL 2005 SQL 2008 ARTICLES
How to find all sales staff involved with touring frames?

Execute the following T-SQL scripts in Microsoft SQL Server Management Studio Query Editor to list sales staff selling touring frames.
-- SQL like operator - wildcard matching - SQL string concatenation
-- SQL inner join
USE AdventureWorks;
SELECT DISTINCT SalesPerson = c.FirstName + ' ' + c.LastName
FROM   Person.Contact c
       JOIN Sales.SalesOrderHeader soh
         ON soh.SalesPersonId = c.ContactID
       JOIN Sales.SalesOrderDetail sod
         ON soh.SalesOrderId = sod.SalesOrderId
       JOIN Production.Product p
         ON sod.ProductID = P.ProductID
            AND p.Name LIKE ('%Touring Frame%')
GO
/* Partial results
 
SalesPerson
Carla Eldridge
Carol Elliott
Gail Erickson
Gary Drury
Janeth Esteves

*/
 

------------

Exam Prep 70-461
SQL 2016 DESIGN & PROGRAMMING
 
 
 
DATETIME SELECT SELECT INTO DATE PAD STRING DYNAMIC SQL CURSOR MONEY FORMAT PERCENT STORED PROCEDURE SQL SERVER AGENT JOB OPTIMIZATION WHILE LOOP OVER PARTITION BY UPDATE