Created
December 10, 2018 00:05
-
-
Save samredai/50d028e973eea9c1c5534d6037d15dc1 to your computer and use it in GitHub Desktop.
MySQL: Create a stored procedure
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
delimiter # | |
DROP PROCEDURE IF EXISTS dataForSomeID; | |
CREATE PROCEDURE `dataForSomeID`(IN needThisID VARCHAR(20)) | |
BEGIN | |
SELECT * | |
FROM sometable | |
LEFT JOIN anothertable | |
ON sometable.id = anothertable.id | |
WHERE id=needThisID; | |
END # |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment