Skip to Content
Learn PostgreSQL
book

Learn PostgreSQL

by Luca Ferrari, Enrico Pirozzi
October 2020
Beginner
650 pages
13h 25m
English
Packt Publishing
Content preview from Learn PostgreSQL
Advanced Statements

In the previous chapter, we started taking our first steps with PostgreSQL. In this chapter, we will analyze the SQL language more deeply and write more complex queries. We will talk about SELECT/INSERT/UPDATE again, but this time, we will use the more advanced options surrounding them. We will then cover JOIN and common table expressions (CTEs) in depth.

The topics we will talk about will be the following:

  • Exploring the SELECT statement
  • Using UPSERT
  • Exploring CTEs

Exploring the SELECT statement

As we saw in the previous chapter, we can use the SELECT statement to filter our datasets using the equality condition. In the same way, we can filter records using > or < conditions, such as in the following example:

forumdb=# ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

PostgreSQL: Up and Running, 3rd Edition

PostgreSQL: Up and Running, 3rd Edition

Regina O. Obe, Leo S. Hsu
Learn PostgreSQL - Second Edition

Learn PostgreSQL - Second Edition

Luca Ferrari, Enrico Pirozzi
The Complete Python and PostgreSQL Developer Course

The Complete Python and PostgreSQL Developer Course

Codestars By Rob Percival, Jose Salvatierra Fuentes

Publisher Resources

ISBN: 9781838985288Supplemental Content