w3resource

PostgreSQL Basic SELECT Statement: Select first ten records from a table


18. Write a query to select first ten records from a table.

Sample Solution:

Code:

SELECT employee_id, first_name 
FROM employees  LIMIT 10;

Sample table: employees


Output:

pg_exercises=# SELECT employee_id, first_name
pg_exercises-# FROM employees  LIMIT 10;
 employee_id | first_name
-------------+------------
         100 | Steven
         101 | Neena
         102 | Lex
         103 | Alexander
         104 | Bruce
         105 | David
         106 | Valli
         107 | Diana
         108 | Nancy
         109 | Daniel
(10 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