Viewing 15 posts - 9,826 through 9,840 (of 10,143 total)
So you want the cases having their most recent step in your list of stepnames? Sorry to be a pain!
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
July 1, 2008 at 10:41 am
Cool, many thanks Pop.
Got a question for you:
SELECT ...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
July 1, 2008 at 9:16 am
Oh all right then. No funny stuff either.
DECLARE @ItemID INT
DECLARE @FirstCol varChar(5), @SecondCol INT, @ThirdCol Char(1)
SET @ItemID = 1
UPDATE #Testing SET ThirdCol = CASE @ItemID WHEN 1 THEN 'D'...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
July 1, 2008 at 8:05 am
Hi Tim
I use the ASCII function for this, usually the first two characters of the column...
DECLARE @tempvar VARCHAR(5)
SET @tempvar = CHAR(10) + CHAR(13)
SELECT ASCII(LEFT(@tempvar,1)), ASCII(SUBSTRING(@tempvar,2,1))
Cheers
ChrisM
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
July 1, 2008 at 7:18 am
Shaun McGuile (7/1/2008)
...so all that is left is a table full of records which were duplicated at least once!
Misleading title though....;)
Jeff, Chris; It falls...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
July 1, 2008 at 7:10 am
lmarcum (7/1/2008)
It is not impossible. Add an identity column. Each record will be numbered. Then use the identity column to delete the duplicate records.
Read the OP's second...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
July 1, 2008 at 6:54 am
Jeff Moden (7/1/2008)
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
July 1, 2008 at 6:52 am
Pop
Your sample data doesn't return any rows. This chunk...
SELECT ...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
July 1, 2008 at 4:09 am
mlando.mngomezulu (7/1/2008)
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
July 1, 2008 at 2:34 am
mlando.mngomezulu (7/1/2008)
Insert into temptable...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
July 1, 2008 at 2:04 am
Nicking Barry's excellent idea (and Janines test data), here's another way which is quite fast:
DROP TABLE #Testing
CREATE TABLE #Testing (
FirstCol varChar(5),
...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
June 30, 2008 at 10:28 am
Jeff Moden (6/26/2008)
Heh... no problem... if you think no coffee is bad, I'm trying to quit smoking... got anyone you want to take to a porkchop dinner? 😀
Ahah that explains...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
June 27, 2008 at 4:56 am
Mark (6/24/2008)
SELECT
A.RetailerID,
X.RetailerIDTheirs
FROM TableA AS A
CROSS APPLY (SELECT TOP 1 B.RetailerIDTheirs FROM TableB B...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
June 24, 2008 at 8:35 am
Hi Simon
This is simple but somewhat restrictive:
SELECT A.RetailerID, MIN(B.RetailerIDTheirs) AS RetailerIDTheirs
FROM #TableA A
LEFT JOIN #TableB B ON B.RetailerID = A.RetailerID
GROUP BY A.RetailerID
This is less simple but offers more flexibility:
SELECT...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
June 24, 2008 at 8:30 am
elmerbotha (6/23/2008)
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
June 23, 2008 at 8:38 am
Viewing 15 posts - 9,826 through 9,840 (of 10,143 total)