Sql unique distinct select

Problem

Write code to simulate the SQL statement “Select unique emp_name from employees”

sql unique distinct select
Solution

Assuming we have an array of employee names we need to write a function that prints the unique employee names in the array. We can use a built in hash table for that matter. Just hash all names then print the keys in the hash table. That is all what we need to do.

Code

Here is how to do that in perl

Please use the comments section below for feedback. Thanks for reading.

Add a Comment

Your email address will not be published. Required fields are marked *