May 2020
Beginner
564 pages
14h 9m
English
To create a stored procedure, you can execute the following query:
CREATE or ALTER PROCEDURE getplayergameinfoASSELECT p.playerid, birthyear, a.yearid,a.teamid, G_defense AS defensegames, H AS numberofhitsFROM appearances AS aJOIN people AS p ON p.playerid = a.playeridJOIN batting AS b ON a.playerid = b.playeridAND a.yearid = b.yearidAND a.teamid = b.teamidWHERE b.yearid = 2017 AND H <> 0ORDER BY p.playerid, a.yearid, a.teamid,G_defense, H;
To call a stored procedure, execute the following query:
EXEC getplayergameinfo;
To create a stored procedure with IN parameters, execute the following query:
CREATE or ALTER PROCEDURE getplayergameinfo @yearid_in smallint, @hits_in smallint
Read now
Unlock full access