Skip to content

Tag: postgresql

How to split time intervals by day in PostgreSQL

I have a query that returns some device state information with device id and timestamp. I am trying to do some daily reports and for that I need to know what state devices were in during the day. So, for example, my query might get me something like this what I want to end up with is What I tried,

LIKE in multiple columns

I have columns title, description, keywords and I want to search a text in them. I’m using PostgreSQL. SELECT title FROM products WHERE ANY(ARRAY(title, description, keywords) like ‘%test%’) I’…