Now that you have connected to your PostgreSQL database you will probably want to read so of the data.  Reading of selecting data is a fairly straightforward process, but can also get very complex very quickly.   Let’s start with the basic sytax.

PostgreSQL SELECT statement syntax

In its simplest form, a select statement starts with “select column_name” followed by “from table_name”.  Something like this:

Here we have asked the database to tell the name of every company in our customers table.  This may produce a large list.  There are several ways to narrow down that list of customers and one way to do that uses the WHERE clause.

Here we only want to see the customer name where the customer ID is 1234.

Was this page helpful?
Let us know if you liked the page. That’s the only way we can improve.
Yes
No