I have a table with 4 columns. that looks something like this. +————————————————————-+ | ID | date | a1 | a2 | +—–…
PostgreSQL select specific items from JSONB array
I have a table like this: orders order_number products 1234 [{“upc”:2434354, “title”:”Widget”}] 4321 [{“upc”:6434556, “title”:”Shorts”}, {“upc”:54346, title: “Shirt”}] I want …
How do I build two selects on different columns?
I´m trying to create a table with two different selects in two different columns. What SQL command can I use? Obs: “NAME_FAB” means Name Manufacturer. Expected result: NAME_FAB Y …
How do I insert a row into a table where one column has the next character on the ascii table for the next 11 available characters?
I am new at SQL (know enough to be dangerous but not enough to do elegant code) I am working with an existing database and they had used ascii characters as unique identifiers.For example: ” Note $ …
How to transpose the vertical data into horizontal by using BigQuery?
I am currently working on the employees’ benefits data. However, the spreadsheet data is totally in a mess. I would like to format it as easy to capture the information. The current formatting is as …
Generate range hours and range numbres SQL/HQL
I have a problem with a table.I currently have this empty hours table and I need to fill it automatically with a query in Hiveql. The idea is to generate: In the first column “key” values between 000000 and 235959 In the second column “hours” values between 00:00:00 and 23:59:59. Now m…
how to combine not null columns in query?
I have a table with only a full column in each row And the rest of the columns are null as follows: +——————————————————————————–+ | f_id | …
Is there a better way to write this SQL query? (UNION)
I tried using OR in the WHERE clause for this code but I get an error on the TIMESTAMP_FORMAT function, but this as such can’t be the issue because it’s exactly the same as in the working code when …
Export ER diagrams from SSMS
I have some ER diagrams created in the development server. I want to export this as PDF and share with my analyst for further usage. The diagram needs to be in PDF format alone since the analyst doesn’…
SQL Server query order by sequence serie
I am writing a query and I want it to do a order by a series. The first seven records should be ordered by 1,2,3,4,5,6 and 7. And then it should start all over. I have tried over partition, …