Forum

Write a PL SQL to c...
 
Share:
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: 2 years ago

Please check the attachment for additional information.

3 Replies
Sambit S
Posts: 47
 Sambit S
(@Sambit S)
Joined: 2 years 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: 2 years ago

getting this error

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

New Member
Posts: 1

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

Reply

Leave a reply

Author Name

Author Email

Title *

 
Preview 0 Revisions Saved
Share: