Skip to content

Remove Duplicate Time Zones From SELECT query

I need help removing duplicate time zone records from my select query without deleting them. The current result is as follows: The table returns duplicate GMT start times for the same employee, the database appears to be duplicating the results based on different time zones. I just want to remove the duplicat…

C# BulkCopy.WriteToServer Changing Values

I have a datatable that is created from and excel sheet. I am trying to SqlBulkCopy.WriteToServer. When I do so it converts my “Percent” value to 0 when my tables schema has type Decimal(38,0) for the “Percent” column. However, it inserts correctly when I have the Data Type as Float. I…

Group by using linked tables

I have linked tables. Calls and Call Lines, both tables have a seperate ‘Call Type’ field, I am trying to get the number of calls and the number of call lines which were added on a certain date and then see the split for the types. The below query returns the number for each Call Line which was ad…

In SQL, how do I prevent array elements from being null?

I’m designing a SQL database and I’d like to make sure my schema is as strict as possible. Is there a way to require that an array column doesn’t contain null elements? As I understand it, I can make the whole column NOT NULL, but that’s not the same thing since an array of null elemen…

Need to identify overlapping dates

I need to find overlapping dates for a table. So the basic structure is ID, PFX, Start date, and end date. So where the PFX for a given ID is overlapping with another PFX for each ID. I tried this and had no luck. https://www.sqlservercentral.com/forums/topic/how-to-extract-overlapping-date-ranges-from-a-tabl…

Transpose rows to columns in Oracle Sql

I want the items in rows to be columns. I have already set up a DBFiddle with the data. Link: https://dbfiddle.uk/?rdbms=oracle_18&fiddle=122a2865fb645e2e226928e28284c590 This is the table I …