w3resource

PostgreSQL Restricting and Sorting Data: Display the jobs/designations available in the employees table


9. Write a query to display the jobs/designations available in the employees table.

Sample Solution:

Code:

SELECT DISTINCT job_id  
FROM employees;

Sample table: employees


Output:

pg_exercises=# SELECT DISTINCT job_id
pg_exercises-# FROM employees;
   job_id
------------
 AC_ACCOUNT
 ST_MAN
 IT_PROG
 SA_MAN
 AD_PRES
 AC_MGR
 FI_MGR
 AD_ASST
 MK_MAN
 PU_CLERK
 HR_REP
 PR_REP
 FI_ACCOUNT
 SH_CLERK
 AD_VP
 SA_REP
 ST_CLERK
 MK_REP
 PU_MAN
(19 rows)

Practice Online


Have another way to solve this solution? Contribute your code (and comments) through Disqus.

What is the difficulty level of this exercise?



New Content: Composer: Dependency manager for PHP, R Programming