I have data that looks like this: I’d like to extract “subquestions” into separate rows (in an sql table): — Making ads for Meta platforms — Producing video content — Applying mobile creatives best… I have a tried a few functions json_extract_scalar, and Map functions etc, but I didn’t succeed. Thanks in advance for your help. So the thing I
Tag: nested
Nested array in a SQL query
I’m fairly new to programming and I’m struggling with an SQL Query. I want, that the purchased articles (article_id) are grouped in an array, so they are connected to the date column. For a further process, they might be combined ( so date x is combined with articles_id [A,B,C]) To make it clearer I want to show what I’ve done
Max from joined table based on value from first table
I have 2 tables. First holds job details, second one the history of those job runs. First one also contains job period, per customer which is minimum time to wait before running next job for same customer. The time comparison needs to happen on started_on field of second table. I need to find out the job ids to run next.
How to replicate nested from statement to nested with statement?
I have created a nested from statement that can be seen below: I am trying to recreate the same results with a nested with statement, I have attempted the below, but it results in a multi-part identifier could not be bound. How would I solve this issue because I thought I named each query correctly? Answer The last FROM statement
SQL nested WERE
I’m a beginner in SQL and I don’t understand the nested WHERE request: When I first request: SELECT movies.title, people.name FROM stars INNER JOIN movies ON movies.id = stars.movie_id INNER JOIN …
Deduplicate table SQL with nested rows (type STRUCT)
I have a SQL table (in BigQuery) with possible duplicated rows. The table has over 20 columns, some of them are nested (data type “STRUCT)”. I want to deduplicate the table. I can’t simply query SELECT DISTINCT * because I get an error Query error: Column options of type STRUCT cannot be used in SELECT DISTINCT So far, I tried
sql nested “sum (case when) or” select query
I have a select query where I am trying to sum a value based on multiple criteria, grouped by dimension. The output will be the sum of the time greater than 30, 90, or 365 days based on the category, grouped by category. I can’t crack the syntax for this, I hope you can help! The concept looks something like
BigQuery nested table UPDATE based on condition of non-nested data AND nested data
I am trying to update records in a bigQuery database that looks like this: Using the code below: UPDATE `tottus-chile.espacio.nested_table` SET addresses = ARRAY( SELECT AS STRUCT * REPLACE(‘…
Add nested column to BigQuery table, joining on value of another nested column in standard SQL
I have a reasonably complex dataset being pulled into BigQuery table via an Airflow DAG which cannot easily be adjusted. This job pulls data into a table with this format: | Line_item_id | Device …
In MariaDB/MySQL, how do I retrieve the same column from different records returned in a single row?
I would like to retrieve a single row that shows the top three colors of products belonging to a specific set. The order is predefined and for some context, the way I would retrieve the top color is …