Skip to content

How to select records from January 1, 2021 to last week

I was wondering how to make a query where I can select data from Jan 1, 21 to last week. I tried to put it in the date filter like this: but I would have to manually go in every week to change the end date, I was wondering if there is a more efficient way to select for data

BigQuery correlated subqueries – transform array to array

I’m trying to join array elements in BigQuery but I am getting the following error message: Correlated subqueries that reference other tables are not supported unless they can be de-correlated, such as by transforming them into an efficient JOIN. In my first table I have something like: field1 | field2 …

How to use SUM(CASE WHEN….) in JPQL Hibernate?

I have the following query: However, this throws a syntax error on the query when I put a case statement inside an aggregate. I can get SUM to work fine alone, and case statements to work fine alone. I’m wondering whether JPQL can support cases in aggregates or if I’m forced to use a native query.…

Get users with no postings or no active postings

I have a rails schema and I have users table and postings table. I am trying to get all users that either have no postings or no active postings. Active being a column on postings that can be true or false. Is the following correct? The thing is, if the user has any postings that are active: true, I DO