PostgreSQL Select Example

In this example, we will show how to use the basic PostgreSQL SELECT statement to query data from a table.

PostgreSQL SELECT Statement Syntax


SELECT
   select_list
FROM
   table_name;

PostgreSQL SELECT Statement Examples

PostgreSQL SELECT Statement Example 1

Using PostgreSQL SELECT statement to query data from one column example:


SELECT first_name FROM employees;

PostgreSQL SELECT Statement Example 2

Using PostgreSQL SELECT statement to query data from multiple columns example:


SELECT first_name, last_name, email, salary FROM employees;

PostgreSQL SELECT Statement Example 3

Using PostgreSQL SELECT statement to query data from all columns of a table example:


SELECT * FROM employees;


Comments