Publishing - Microsoft Developer Studio - [reptq2 : Stored Procedurę (pubs)]
1) File Edit View insert Project Build Jools Window Help
"3 «*©
_l*
B-tj§P PubDB
i -i pubs (PENTIUM)
0 1_] Database Diagrams ffl P~1 Tables Ę O Views
< I ' • " |
►r |
■1CL R... I *] Fil... 9 D... |
7^ |
CREATE PROCEDURĘ reptq2 AS
select type, pub_id, titles.title_id, au_ord, Name = substring (au_lname, 1,15), ytd_sales froi titles, authors, titleauthor where titles.title_id = titleauthor.title_id AND authors.au_id = titleauthor.au_id AND pub_id is NOT NULI order by pub_id, type
COMPUTE avg(ytd_sales) BY pub_id, type COMPUTE avg(ytd_sales) BY pub_id
Running dbo.reptq2. |
▲ | ||||||
type |
pub_id |
title_id |
au_ord |
Name |
ytd_sales | ||
business |
0738 |
BU2075 |
1 |
Green |
18722 | ||
(1 row(s) affected) | |||||||
AVG | |||||||
18722 | |||||||
(1 row(s) affected) | |||||||
type |
pub_id |
title_id |
au_ord |
Name |
ytd_sales | ||
psychology |
0736 |
PS2091 |
2 |
Ringer |
2045 | ||
psychology |
0736 |
PS2091 |
1 |
Ringer |
2045 | ||
psychology |
0736 |
PS2106 |
1 |
Ringer |
111 | ||
psychology |
0736 |
PS3333 |
1 |
Uhite |
4072 | ||
psychology |
0736 |
PS7777 |
1 |
Locksley |
3336 | ||
(5 row(s) affected) | |||||||
AVG |
a | ||||||
4 1 ► )>ug \ Find in Files 1 \ Find in Files2 \ |
Results |
SQL Debugging / | 4 \ |
►r |
Ready
Start
r:, m... |
t3P:- |
6Js- |
il w.. |
BFMi... |
t3P:- |
8 A... |
1^*1 K... |
tfE... |
«©P...
IFr...
Ln 13, Col 65 RE AD
W
2:07 PM