I have a column of type jsonb[] (a Postgres array of jsonb objects) and I’d like to perform a SELECT on rows where a criteria is met on at least one of the objects. Something like: — Schema would be …
Tag: sql
Finding revenue based on shared ID’s, SQL
I barely know how to ask this question or if this is possible in SQL. I work for a sales company and reps will frequently share accounts with eachother under “Split Codes”. I have a table that …
Slow query when joining with a materialized view
I’m trying to diagnose a slow query I have against a materialized view in Postgresql (10.12). In brief, I have two tables activity and task plus a materialized view, activity_status_view that is …
I need a query that selects individuals with a birth date from January 1 two years ago through yesterday’s date
I need a query that will pull all children with a birth date from two years ago through yesterday. So using today as a for instance the query would return everyone with BirthDT from 1/1/2018 to 3/4/2020. For the remainder of 2020 the Start Date will always be 1/1/2018 and End Date will vary depending on the d…
Show Unique values only
I am using SQL Server 2019 and looking for a way to show ONLY the latest value for each AOC based on its latest FW_Version. Here is my query I have so far but this shows everything: What I would like to show ONLY items marked in yellow… How can I make this happen? Here is the list of my
Difference between NVL and OR in SQL oracle
Hej guys, could someone explain to me difference between NVL() and OR in below query : Number of rows: 44937 and Number of rows: 44782 Why we have this difference: 155 rows? i built a few query based on nvl and notice that issue and going to switch to OR, but I really want to know, why it such a
Multi-parameter search with mysql and node.js
Let me preface by saying I’m very new to SQL (and back end design) in general. So for those annoyed with noob questions, please be gentle. BACKGROUND: I’m trying to build a product test database (storing test data for all our products) where I want a user to be able to refine a search to find test…
Mysql Group By age by range [closed]
Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 2 years ago. Improve this question i need help, i need to create report like this the report is group by the age, but i canR…
how to convert minutes to days in oracle
How would you convert a number of minutes to number of days? For instance, number of minutes is 20160. Now how do I get number of days based on that using SQL?
SQL statement HOW to count all relevant rows (A,B) and (B,A) together
I am trying to count all rows where seller and buyer has also an inverted relationship. So the buyer sells to seller. I do not have any clue to group them together. Table T1| ———————- …