Skip to content

Tag: postgresql

Postgres SQL select query syntax

I have this SQL statement, I am getting a syntax error: SELECT * FROM user_table INNER JOIN ( klass_table LEFT JOIN room_table ) Syntax error is vague, it says: You have an error …

Database Query to generate a Time-based Chart

I have a logins table in the following (simplified) structure: Now I want to generate chart like this: https://prnt.sc/mifz6y Basically I want to show the logins within the past 48 hours. My current query: This works as long as there are entries for every hour. However, if in some hour there were no logins, t…