Skip to content

Tag: sql-server

SQL SUM on multiple INNER JOIN

I am trying to get the sum of particular fields through multiple table using joins. I am getting the SUM wrong when I I try to get the values together. I have table State as I have another table Balance as I have one more table Loan as What I want as a result from my query is, When I

SQL Server: Update table based on JSON

I am trying to update rows in table based on JSON I have. JSON has the following structure: Table dbo.sensors has same structure + few more columns. To insert such JSON object, not array, into table, I would do it this way: So I have 2 questions: how to iterate over each element in JSON array and update each …

Extract string between double quotes in SQL

I have a string and I need to return the characters between the double quotes ‘((“Name 1” and “Name 2”) or “Name 3”) I need to return I have used the function below to split the string but I am getting the (( and the Or and AND etc .. which I don’t want and unfo…

Filter out certain rows based on condition

I have this Input Table: I want to check each project separately then exclude If the project owner has his name inside col2 and other people with him, then remove the row which is repetitive Jack Jack, a. For example, In Project B Jack has his name inside Col2 and he is working with Maria , so remove Jack Jac…