mercredi 3 février 2021

MYsql Pattern Printing

I need to print pattern in this format in MY SQL . Here is my code :

* * * * * 
* * * * 
* * * 
* * 
*

Mysql code :

declare @i int 
select @i = 20
while @i>0
begin
print repeat('*' ,@i)
set @i=@i-1;
end ;

I'm getting error in solving this . Please someone tell me the changes needed to make this work

Aucun commentaire:

Enregistrer un commentaire