Viewing 15 posts - 31 through 45 (of 166 total)
I think what you want is to pack intervals of data. I found several articles that helped me with that challenge, which I needed to solve for working hours. Here...
March 22, 2019 at 7:21 am
You may be able to use the EXCEPT clause. Read about it here: https://www.tutorialspoint.com/sql/sql-except-clause.htm
From their explanation: "The SQL EXCEPT clause/operator is used to combine two SELECT statements and returns rows...
March 22, 2019 at 7:14 am
Option 3:WHERE T.name LIKE '%table_pattern%'
March 22, 2019 at 7:12 am
sgmunson - Thursday, March 21, 2019 10:37 AMI see a potential performance issue with the recursive CTE, which is not necessary.
Steve,...
March 21, 2019 at 10:11 pm
Seriously looks like a homework problem.
March 20, 2019 at 2:29 pm
Here is my take on the solution. Let me know if you see any issues.
WITH SortedData
AS (
SELECT Id, Pro, Type, Qty1, Qty2, ModifiedDate,
ROW_NUMBER() OVER (PARTITION BY...
March 20, 2019 at 2:27 pm
One thing to check is whether the login used for the SQL Agent has permissions to see the table in question, and to use the sp_send_dbmail procedure, and to create...
March 11, 2019 at 4:58 pm
I know the question has been answered, and the solution in this case did not need to run a statement on every database. However, that functionality is sometimes needed, and...
March 11, 2019 at 4:53 pm
I think you are trying to delete from Table1 where matching rows exist in Table2. If that is correct, then I think this is what you want:delete...
March 11, 2019 at 4:45 pm
The first thing to check is what indexes are being used to return data in each of the queries. My guess is that there are good indexes in the transactional...
March 11, 2019 at 4:33 pm
Look at the number of unique - distinct - values in the columns you are using. If there are not records in the table that have the same value, then...
March 11, 2019 at 4:23 pm
February 1, 2019 at 12:05 pm
OK, attempt #2. The CTE tells which rows are first and last in their block, the "Blocks" query puts those values into ranges, which can then be joined to the...
February 1, 2019 at 7:42 am
I took a stab at this one. I needed sample data, so I generated it using the following code. Because RAND is used with a predictable seed, the values will...
January 31, 2019 at 12:14 pm
By the way, the above code assumes no nulls in the Reading and Consumption fields. If there can be nulls, then the code should be adjusted to account for them...
January 31, 2019 at 11:26 am
Viewing 15 posts - 31 through 45 (of 166 total)