Need some help with maths side of things with this bit of code. You may see I need help on even more! But any help you could give me would be great Basically, my aim is to bring back an; – AccountID,…
C# Error : Unable to insert record in SQL
Please pardon my knowledge on C# as I am very new to it,I am unable to insert a record in SQL and getting the below error while insert image to SQL. Error : Object reference not set to an instance …
SQL CASE statement needs to handle Text
Apologies if this has been asked before – I’ve spent a couple of hours searching but not found anything that’s helped. It’s quite simple really – I’ve been asked to create a query which includes a field that when it was set up (not by me) was created as a VARCHAR instead of…
Add count() to pivot table with totals
I have the following query: (simplified to one year) WITH myTable AS (SELECT cv.Company, cv.Zip, DATEPART(year, od.OrderDate) AS TheYear, ” + …
How to select * from table but distinct on 1 column and order by on another column
I have a messages table with fields channel_number, body, created_at, recipeint_id & sender_id I want to have messages distinct on channel_number and order by messages.created_at basically I want …
SQL table with a column which may have “multiple types of NULL” values
The title may be confusing so I need to clarify. I have the following survey dataset that I need to transfer to a PostgreSQL database. Where -10000, -20000, and -30000 all represent a null value, but due to different reasons. (e.g., -10000 means that the participant was not shown the question about the column…
How do I create a structure for a dynamic SQL query?
In my Golang application I make SQL request to the database. Usually, in the SQL query, I specify the columns that I want to get from the table and create a structure based on it. You can see an example of the working code below. QUESTION: What should I do if I don’t know the number and name of columns
Binding dates to SQL in Python for cx_Oracle
I am using the following query to select logs fro a logs table. I have the following dictionary of parameters: and executing the query as follows : Now the problem is I am not getting any values for this date range. But if I execute the query in Oracle, by specifying the dates, it is working. What is wrong he…
Update the Unique number for the co-related records between two columns in the group
I need to identify and update co-related records associated rank under Req_Result column as depicted below. Table name is tblSource. +——+—–+—————–+———+ | Item | key | …
Scan row into slice
I want to Scan a sql.Row into a slice like so: but I am getting this error: 2020/02/23 20:05:14 raw query: SELECT * FROM user_table LIMIT 500 2020/02/23 20:05:14 sql: expected 6 destination arguments in Scan, not 0 anyone know how to make this generic without using a slice? Answer You can do it this way: on t…