Viewing 15 posts - 8,506 through 8,520 (of 10,144 total)
Hello
Two quick suggestions.
Firstly, merging the rows:
select a.*, '#' AS '#', b.*
from db..table a with (nolock)
LEFT JOIN db..table b ON b.id = a.id + 1 and b.RecordType='C'
where b.id in (944770735,944770759,948267730,948267745)
Secondly...
April 14, 2009 at 5:20 am
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...
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...
April 13, 2009 at 3:45 am
Please post the script for the table, this will help to clarify your requirement.
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...
April 10, 2009 at 6:24 am
Steve Jones - Editor (4/8/2009)
April 10, 2009 at 2:35 am
arun_anand09 (4/9/2009)
Whats the...
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],...
April 9, 2009 at 9:44 am
ben.rosato (4/9/2009)
April 9, 2009 at 8:25 am
Next:
A.[vchUser3] in (103235, 103236)
toA.[vchUser3] in ('103235', '103236')
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"...
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...
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...
April 9, 2009 at 7:44 am
Scott (4/9/2009)
TRX_CODE TRXID
AAA1 19212312
AAA1 ...
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...
April 9, 2009 at 7:32 am
Viewing 15 posts - 8,506 through 8,520 (of 10,144 total)