Viewing 15 posts - 8,506 through 8,520 (of 10,143 total)
Peso (4/13/2009)
But you too will have to check for mutually exclusive records as with Mr Magoos test data.
EDIT: I tried your algorithm with the sample data provided by...
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
April 13, 2009 at 10:52 am
It will work with a more sparse data set than the one provided by Barry too. Here's how it works:
Determine the minimum values for each column
Identify the row which contains...
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
April 13, 2009 at 3:45 am
Please post the script for the table, this will help to clarify your requirement.
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
April 11, 2009 at 2:30 am
RBarryYoung (4/10/2009)
Nice explanation, Peso.Of course, in this example you are assuming that the first record is easy to identify, but even that is not necessarily so.
It sounds very...
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
April 10, 2009 at 6:24 am
Steve Jones - Editor (4/8/2009)
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
April 10, 2009 at 2:35 am
arun_anand09 (4/9/2009)
Whats the...
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
April 9, 2009 at 10:14 am
Hey Flo that was quick:-P
DECLARE @Reference_number VARCHAR(6),
@Amount MONEY,
@Start_payment_date DATETIME,
@interval_type CHAR(1),
@interval_unit SMALLINT, @sql VARCHAR(200)
SELECT @Reference_number = '100001',
@Amount = 100.0,
@Start_payment_date = '15 may 2009',
@interval_type = 'm', --(monthly)
@interval_unit = 1
SELECT @Reference_number AS [Reference_number],...
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
April 9, 2009 at 9:44 am
ben.rosato (4/9/2009)
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
April 9, 2009 at 8:25 am
Next:
A.[vchUser3] in (103235, 103236)
toA.[vchUser3] in ('103235', '103236')
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
April 9, 2009 at 8:13 am
Then a brief process of elimination:
SELECT E.[IncidentID], CAST(E.[IncidentID] AS NVARCHAR(25))
FROM store.dbo.orders E
WHERE CAST(E.[IncidentID] AS NVARCHAR(25)) LIKE '%.%'
Edit to add comment: This is the only column which doesn't have an "i"...
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
April 9, 2009 at 8:04 am
ben.rosato (4/9/2009)
If you change the last join to the following it works:Inner JOIN store.dbo.orders E
ON CAST(A.[iSystemId] AS NVARCHAR(25)) = CAST(E.[IncidentID] AS NVARCHAR(25))
Both of those colums are indeed int
Try this: Inner...
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
April 9, 2009 at 7:54 am
You're totally right Flo, it's overkill, all you need is patindex. It was just for fun.
Try this:
ISNULL(NULLIF(PATINDEX('%[^A-Z]%', NameTrim),0), LEN(NameTrim))
which means: if patindex returns 0, replace it with null, so you...
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
April 9, 2009 at 7:44 am
Scott (4/9/2009)
TRX_CODE TRXID
AAA1 19212312
AAA1 ...
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
April 9, 2009 at 7:38 am
manohar (4/9/2009)
Ur logic works only in the case of alphanumeric values... I throws error in case of string
The error is
------
Msg 245, Level 16, State 1, Line 17
Conversion failed when...
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
April 9, 2009 at 7:32 am
Thishave , after 3 characterwould indicate a VARCHAR or CHAR datatype. Check the datatypes of the columns in the tables. Try casting to INT or BIGINT the column which has...
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
April 9, 2009 at 7:11 am
Viewing 15 posts - 8,506 through 8,520 (of 10,143 total)