DEV Community

Cover image for How to use delimiter in MySQL
The Dream Coding
The Dream Coding

Posted on

How to use delimiter in MySQL

when writing SQL statements , we use
the delimiter to separate betwene
two Statements

delimiter ;
select * from school ;
delimiter $$
select * from student $$
Enter fullscreen mode Exit fullscreen mode

=>the default delimiter
is semicolon (;)

select * from school ;
Enter fullscreen mode Exit fullscreen mode

=> Setting a different the delimiter
allows us to execute all statements
as a single statements

for example

delimiter $$
create function (para int) returns int
begin
-- statement 
end
$$
delimiter ;
Enter fullscreen mode Exit fullscreen mode

=> in this statement we want to execute
function or stored procedures in one
statemente . so , we use dilimiter

i explaine how to use delimiter in MySQL on youtube

click this => vidéo

this is my channel on youtube

click this => The Dream Coding

Top comments (0)