Viewing 15 posts - 91 through 105 (of 113 total)
The issue could be related to the nullability of some of the columns. The are different ways to tackle this but using CHECKSUM is not one of them because the...
October 4, 2013 at 1:44 pm
This problem is known as Relational Divsion[/url].
There is the exact division (only 3 and 6) and the one with a remainder (at least 3 and 6). Yours seems to be...
October 2, 2013 at 12:52 pm
It is very helpful to include table definition, sample data in the form of "insert" statements and expected result. That way we don't have to guess column names, data types,...
September 28, 2013 at 4:40 pm
This problem is known as Relational Division[/url].
SET NOCOUNT ON;
USE tempdb;
GO
DECLARE @T TABLE (
Rate int NOT NULL,
Shift int NOT NULL,
PRIMARY KEY (Rate, Shift)
);
INSERT INTO @T (
Rate,
Shift
)
VALUES
(1, 1),
(1, 2),
(1, 3),
(2, 5),
(3,...
September 26, 2013 at 1:34 pm
I changed [path] by order_val in the recursive part and now it should run flawless.
A recursive CTE is still an iterative approach so I do not hold my breath hoping...
September 23, 2013 at 5:40 am
This problem is known as "Finding Islands", but this case is a special one because there is no other column that we could use to break ties based on (CID,...
September 22, 2013 at 3:40 pm
One way to accomplish this is using a varbinary column to concatenate the sequence of numbers based on the position value.
WITH C1 AS (
SELECT
Id, IdRoot, Name, Position,
CAST(ROW_NUMBER() OVER(ORDER BY...
September 22, 2013 at 2:53 pm
Since you are using SS2012, here is a possible solution using the offset function LEAD.
Supposing all exclusions are inside the order interval, the idea is to generate the intervals between...
September 14, 2013 at 4:00 pm
Sorry for the formatting but I have no idea how to post T-SQL code.
September 14, 2013 at 1:24 pm
The approach I would use is first to pack overlapping intervals and then find the gaps.
You can read about both methods in the last book from Itzik Ben-Gan about "High...
September 14, 2013 at 1:23 pm
If I understood it correctly, you want groups of 63 rows supposing they are consecutives and then select the first row for each group.
WITH T AS (
SELECT
...
August 30, 2013 at 1:56 pm
If you have maximum one comment per (Dealer, Year, Month, Car_Id) then you can enumerate the rows and then use a FULL OUTER JOIN.
SET NOCOUNT ON;
USE tempdb;
GO
DECLARE @T1 TABLE (
Camry_Id...
August 30, 2013 at 1:04 pm
What version of SQL Server are you using?
I am not sure is you are looking for the last non-zero value or the maximum non-zero value. Anyway, filter the rows to...
August 29, 2013 at 2:00 pm
Viewing 15 posts - 91 through 105 (of 113 total)