Skip to content

fetch the data from array of objects sql BigQuery

I need to fetch key value pairs from the second object in array. Also, need to create new columns with the fetched data. I am only interested in the second object, some arrays have 3 objects, some have 4 etc. The data looks like this: The desired output: Answer Below is for BigQuery Standard SQL if applied to…

Select how many documents are in other table for each person

I have 3 tables. Client,Documents and ClientDocuments. The first one is the clients,where the information for each client are. The second one is the documents, which document can go in the system. The third one is the ClientDocuments, which client has which document. Tables Here I have to do a select where i …

Incorrect datetime value in MySQL table

I have just created a new MySQL in an AWS Ubuntu instance. Then I have copied a table from another MySQL server to the new created database. This is the structure from some fields from one of the tables: My issue is that every time I try to enter a new record on the table, there is an error at

PostgreSQL Btree index on top of Unique index

I have a table with a unique index. CREATE UNIQUE INDEX task_index ON public.task USING btree (id, user); Most of my selects are using where id=? So do I still need an index on ID column? Or the …