technical skills grow

Responsive Ads Here

Monday, November 22, 2021

Part-21 For & While Loops in PostgreSQL

PostgreSQL provides the for loop statements it execute until condition is not false it is check print value one by one in loop .

Code :1

do 
$$
declare r1 int ;r2 int:=2;
begin
for r1 in 1..10 loop
raise notice '%',r1* r2;
end loop;
end
$$

Code :2

do
$$
declare r1 int ;
begin
for r1 in reverse 10..1 loop
raise notice '%',r1;
end loop;
end
$$


Task : Fetch data only which employee id is Odd



WHILE LOOP 



No comments:

Post a Comment

Powered by Blogger.

Labels

Contact Form

Name

Email *

Message *

Search This Blog

Blog Archive

Ad Code

Responsive Advertisement

Recent Posts