I’m having trouble sorting this out. I want to see the fiscal quarters for Date_Received. When the @ReviewPeriodQuarter = 1 then I want the Date_Received months 10,11,12. If @ReviewPeriodQuarter = 2 then I want the Date_Received months 1,2,3 etc. SQL Server doesn’t like the BETWEEN part of this. T…
Transform properties from JSON array into comma-separated string
I have a string column in an SQL-Server table on Azure which contains the following data: How can it be transformed into a comma-separated string containing “Jane, John”? Answer Here how to achieve this via a snippet of some of my older code, you should be able to loop through the table and do thi…
Converting sql data to json but json file include recordset
I’m trying to convert sql data to json data but when file is completed I get something ‘recordset’ what is this and how do i get rid of it. —–This is how I am getting the json .— Please tell me how i get rid of recordset, square brackets and output and rowsafftectd Answer W…
SQL* Is there a way to make a procedure that will verify what time and day?(Beginner) SQL*
It’s for a school project and I know it may seems basic but I’m wondering how to make a procedure that will verify what time and day it’s actually is like monday and not the date. thank you Answer Please use this – Pls note, you can use ‘DAY’ to get all caps, ‘DayR…
Is a rollback necessary when insert of a single database record fails?
I am not too familiar with database transactions. I was wondering about a situation where a single record is being inserted into a database. Is a transaction necessary. If so, if the insert of the one record fails, is a rollback necessary? I am asking this related to JDBC but is can be in a general database s…
ORA-00907: missing right parenthesis again
Why? I have used before, I don’t know if it makes a difference but… what’s is wrong with this? Answer multiple issues : Identity column in Oracle are created using generated always as identity Int datatype doesn’t need length. referencing to another table is based on columns , you need…
BigQuery, NULL values when joining transactions and currency exchange tables
I need to convert transactions imports over the last 3 years present in a table to €. To do this, I took a separate table with conversion values. So I need to join this two tables, attach the right conversion rate to the first table. The rates table has two fields (valid_from and valid_to) that contain the ra…
How to deal with JSON column while using GROUP BY
I’m using a query similar to the below one, address is JSON TYPE. But getting below error: I’m trying to get the data of a person who has the max salary for his age and I need to include adress filed which should be JSON So, Is the there any way to achieve this or is this practically possible ?
How do i use a selected column as a variable for the next selection of the same sub-query
I am trying write a query to create a report and for the report, I need to get the manager of the user who created a form on our system. Because the system is old and changed a lot, there is no easy …
Get number of days between two dates in SQL
Fleet_ID State ODO_Reading Date_Added 1 F1 State 1 42000 10/01/2021 2 F1 State 1 43100 14/03/2021 3 F1 State 1 43900 26/04/2021 4 F2 State 1 63010 22/02/2021 5 F2 State 1 70800 06/04/2021 6 F3 State 2 17000 03/01/2021 7 F3 State 2 18560 19/03/2021 8 F3 State 2 19695 23/04/2021 Above is a sample database Is it…