Skip to content

Tag: sql-server

Combining Values in a Column by Date

I have been tasked with writing this simple query and am not sure where to go from here. I am trying to create a report that shows 3 columns: Date_Column, Id_Column, & Amount_Col. The table for Id_Column has different IDs based on a location column (in the table, but not in my query below). For the report…

How to eliminate this SQL String_Split function error

Trying to use the SQL string_split function in a dynamic query but I continue to receive the following error. Invalid column name ‘Invoice Description’. Argument data type void type is invalid for argument 1 of string_split function. I can not figure out the issue. Any help is greatly appreciated.…

How to combine multiple rows (one column) into One row

I am using SQL server 2017 and I have a scenario where I want to combine multiple rows of data into one row. Please see the below screenshot and let me know if that is possible. Thank you. Apologies if anything is missing. Please let me know the query on how to achieve this Answer SQL Server has supported str…

Remove duplicate rows from a big table

I’ve got data from third party and imported to SQL server. The table has 255,072,636 records and 61,714,772 are unique among these records. The table has neither specific order nor any index. The table has 4 columns: Field1(float), Field2(varchar(255), Field3(varchar(255), Field4(varchar(255). I want to…

Unexpected results with consecutive + and – [closed]

Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 1 year ago. Improve this question I have the following queries : The result is : How is this output explained…