I want to get metadata of impala db in one query. Probably It will be like SELECT columnname,tablename,schemaname from SYSTEM.INFO Is there a way to do that? and I dont want to fetch only current …
How to define self-defined log in SQL Server
I am now dealing with a huge table that contains XML each row. My job is to write sp to parse the XML and insert its data to the other corresponding tables row by row. But there is a problem that when the sp interrupts, partial data is inserted into the new table while the others are not. So, I
How to use SQL find first matching result from one table in another table?
Suppose I had two tables: What I want to do is write a query that will find the first sale for each customer. I am not sure exactly how to do it. I feel like this is group by problem, but the answer is not coming to me. EDIT: I feel like my first data table did not fully explain
How to extract different json elements from the same table in SQL query?
I am querying from a table with the following format: id|provider|score ——————————– 1 | att | ‘{“attscore”:300}’ 1 | verizon | ‘{“verizonscore”:299}’ 2 | …
Select text from inside a string after a keyword
I have a column in SQL Server that has a string that looks like this. I’m trying to get the value of the “some_id” which in this case would ‘12345678911’. Any help on how I could get just …
Create pivot table in Postgres 9.6
I am having trouble creating the desired output using SQL. I have an events table, that holds a record for every event taken by each candidate, as so: | id | asmnt | timestamp | score | |–…
Combine / Join SQL queries
I have a query which gets data from a JSON document, checks which values have been returned and then returns that count. As part of this query, I’d like to also return cat_name, dog_name and add a WHERE pet_store = ‘london’ I’m not sure exactly where I’m suppose to add the other …
Combine different CTE json objects together
I am having difficulties grasping the concept of combining two CTE json objects together. The data from the two are matched by a field WOID, which is the “workOrderID” in this json. I do not know …
Count number of values in SQL query / bigquery
I have a query which extracts some data from a JSON document and I have a query that based on the number of values returned displays an overall column count. I can’t seem to work out how to combine these into a single query? assume that I need to use a sub-query but not sure where to go from here?
Trying to do basic subtraction from a database table
I’m trying to subtract data based on user input, for example: UPDATE table SET quantity=quantity – * some input value* This is easy if I’m subtracting field by field, where id=1…2…3, but I want to subtract values automatically when I input quantity, so if input is 60, and there i…