I am trying to find how I can calculate Percentage from table below From the above table, I am hoping to get the data with percentage like below. However my SQL statement below returns all percentage …
Retrieving specific column data from SQL sub-query
My goal is to pull out the values shown in red in the picture. I used this query to pull the data together. The rows are associated via ActionID and filtered with the ‘AND’ conditions shown. SELECT […
How to extract list of values from JSON in SQL Server
In a SQL Server database, I have a table that contains 2 columns, ID and JSON. The JSON column contains JSON-formatted text. I have access to ISJSON, JSON_VALUE and JSON_QUERY, but not OPENJSON. I am …
Azure Stream Analytics Job delayed output of not matching records by 1 minutes between two event hubs
Could anyone help me, why the not matching records are delayed by exactly 1 minutes but the matching records are writing into blog storage container immediately. Is there any way to avoid the delay even though eventA its not matching with other eventB (being my downstream system will take care in my use-case)…
T-SQL Convert Arithmetic Formula into its Components
Problem Statement: I have a Formula column that has the arithmetic operation in it. I want to extract the variable names from the formula, and delimit the variables with a comma and create a New …
Unique constrains on different type [closed]
I have two columns like these: A = {1,2,3}; –> Integer[] Type B = 3; –> Integer Type I would like to UNIQUE constrains this 2 columns of different types. There is a method to compare all the …
C# INSERT to SQL method exception when DateTime parameter is null
One of my parameter looks like this: I know that User has null value in last_sign_in_at. Database accept nulls for this column but I get an exception: SqlException: The parameterized query ‘(@id int,@name nvarchar(18),@username nvarchar(11),@state nvarch’ expects the parameter ‘@last_sign_in…
Mysql comma seperated to json-array
I have some fields in the database that are comma selerated, something like: a,b,c,d,e and I want to convert them into: I know how to do it in nodejs / any other language, but I need to do it directly on the mysql Possible? Thanks Answer The simplest approach probably is to use string functions only: Basicall…
SQL select single row number x only
For processing SQL data in VBA I want to use a loop (For…Next) that reads line by line from a SQL database. As records were deleted the ID column has gaps. The table looks for example like this: Having four lines I would like to run of course a “For each” would do good, too. Answer If you wa…
find exact number in text field in sql
I am trying to query exact number in array inside text field in sql so for example can return which is not good because i would like to get the arrays that contain 1 Answer You could use JSON functions: