Forum

Write a PL SQL to c...
 
Notifications
Clear all

Write a PL SQL to count the locations, where the various departments are located and print the number.


Rahul U
Posts: 1
 Rahul U
Topic starter
(@Rahul U)
Joined: 1 year ago

Please check the attachment for additional information.

3 Replies
Sambit S
Posts: 47
 Sambit S
(@Sambit S)
Joined: 1 year ago

Write a PL SQL to count the locations, where the various departments are located and print the number.

Try this one.

To count the locations, where the various departments are located and to print the number.  

Declare
V_cnt number:=0;
Begin
Select count(distinct loc_id) into v_cnt
From department;

Dbms_output.put_line('Number of location are '||v_cnt);

End;
Reply
Rahul Updhyay
Posts: 17
(@rahul)
Active Member
Joined: 1 year ago

getting this error

 
Reply
1 Reply
Sandesh Kulkarni
(@sandeshk)
Joined: 4 months ago

New Member
Posts: 1

@rahul can I please get the exact query for that.

Reply
Share: