An Interest In:
Web News this Week
- April 23, 2024
- April 22, 2024
- April 21, 2024
- April 20, 2024
- April 19, 2024
- April 18, 2024
- April 17, 2024
November 12, 2022 09:49 am GMT
Original Link: https://dev.to/thedreamcoding/how-to-create-function-in-mysql-4lg0
How to create function in MySQL
1. Syntax
drop function if exists function_name ;delimiter $$CREATE FUNCTION function_name [ (parameter datatype [, parameter datatype]) ]RETURNS return_datatypeBEGIN -- statementsEND$$-- for use the function select function_name(parameter);
2. example
drop function if exists countscoll;delimiter $$CREATE FUNCTION countscoll( cit int ) returns int begin declare tota int ; set tota = ( select count(*) from school where city = cit ); return tota ;end$$delimiter ;select countscoll("new york");
3. remark
we use function when we return value or Variable
4. i explaine how to create function in MySQL on youtube
click this => vido
5. this is my channel on youtube
click this => The Dream Coding
Original Link: https://dev.to/thedreamcoding/how-to-create-function-in-mysql-4lg0
Share this article:
Tweet
View Full Article
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To