Skip to content

comparing two tables and removing ones that match

I have two tables. MembID is the only column returned for each. The MembID can be in both tables but I would like to remove the ones that are in both from the results. I’d like the final return to be …

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,

SQL check whether current date is monday

I am trying to create a SQL statement in where clause so when the current date is a Monday, it returns Friday results, but if it is any other weekday, it returns yesterday as the result. Something …