Skip to content

Use SQL Function as select parameter

I have a sql table with a structure like this: Each column is a hour of day (I can’t change the structure of table) If I want to get the value of 13:00pm I have to write a query like this: SELECT …

Create new PostgresSQL schema

What’s the easiest way to create a new Postgres scheme inside the database on the runtime and also, create the tables written inside a SQL file? This is a Spring boot application and the method receives the schema name that needs to be created for the db. Answer Although it sounds like this would be a c…

Find groups that are missing values of one column

Hopefully someone can send some light on an issue I’m trying to resolve. Types Codes I would like to be able to determine those Code/ID pairs that are missing a particular type. The result of this query should yield. Answer You need conditional aggregation for this: Another option is to cross join the p…