Viewing 15 posts - 5,656 through 5,670 (of 10,143 total)
rajawat.niranjan (9/13/2012)
Thanks @chrism-2@WorkIt worked 🙂
But what was wrong was is null sort or something else?
Each option in the CASE construct, including the ELSE, must have the same datatype - otherwise...
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
September 14, 2012 at 2:01 am
BeginnerBug (9/13/2012)
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
September 14, 2012 at 1:45 am
BeginnerBug (9/13/2012)
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
September 13, 2012 at 9:56 am
aaron.reese (9/13/2012)
...Why do you need to be able to unencrypt the encoded data?
Interesting point - if you can't decrypt it, is there any argument for keeping it?
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
September 13, 2012 at 9:48 am
Try this:
declare @var int =2
select ClientInternalID, ClientName, NULL ParentInternalID
from TB_Client cl
CROSS APPLY (
SELECT OrderBy = CASE @var
WHEN 1 THEN CAST(ClientInternalID AS VARCHAR(10))
WHEN 2 THEN CAST(ClientName AS VARCHAR(10))
WHEN 4 THEN...
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
September 13, 2012 at 9:09 am
ScottPletcher (9/12/2012)
It would have to be THE ONLY WAY POSSIBLE for me to...
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
September 13, 2012 at 8:49 am
Lynn Pettis (9/13/2012)
ChrisM@Work (9/13/2012)
SELECT
Data,
ChangedData = STUFF(Data,50,25,SPACE(25))
FROM ( -- note: '[' is position 49 and ']' is position 75
SELECT Data = 'ZY0503400000234567891234567890110000000000088975[_5668550000000XXXXXXXXXXX]'
) d
WHERE LEFT(Data,8)...
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
September 13, 2012 at 7:54 am
m.henly (9/13/2012)
Cheers,
...
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
September 13, 2012 at 7:21 am
STUFF() is perfect for this:
SELECT
Data,
ChangedData = STUFF(Data,50,25,SPACE(25))
FROM ( -- note: '[' is position 49 and ']' is position 75
SELECT Data = 'ZY0503400000234567891234567890110000000000088975[_5668550000000XXXXXXXXXXX]'
) d
WHERE LEFT(Data,8) = 'ZY050340'
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
September 13, 2012 at 7:13 am
dwain.c (9/13/2012)
ChrisM@Work (9/13/2012)
SELECTId, A, B, C,
MinVal
FROM #MinAmt
CROSS APPLY (
SELECT MIN(a)
FROM (VALUES (A),(B),(C) ) v (a)
WHERE a > 0
) x (MinVal)
😉
And the referee throws down...
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
September 13, 2012 at 5:11 am
Eugene Elutin (9/13/2012)
It's only going to work if you use dynamic sql.
Please note, if you run the following type of...
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
September 13, 2012 at 4:29 am
UPDATE tr SET
FV_Flag = 'N',
EX16 = ao.EX16
FROM Results tr
CROSS APPLY (
SELECT TOP 1
ao.EX16,
ao.Date_Effective
FROM AddOns ao
WHERE ao.Customer = tr.CustBookId
AND ao.FmNo =...
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
September 13, 2012 at 3:02 am
dwain.c (9/11/2012)
ChrisM@Work (9/11/2012)
DECLARE @AmountToAllocate INT = 21
;WITH Calculator AS (
SELECT
BucketID, TotalSize, Amount,
AmountLeftToAllocate...
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
September 13, 2012 at 2:41 am
SELECT
Id, A, B, C,
MinVal
FROM #MinAmt
CROSS APPLY (
SELECT MIN(a)
FROM (VALUES (A),(B),(C) ) v (a)
WHERE a > 0
) x (MinVal)
😉
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
September 13, 2012 at 2:31 am
SQLRNNR (9/12/2012)
premeditated
Premedicated
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
September 13, 2012 at 1:50 am
Viewing 15 posts - 5,656 through 5,670 (of 10,143 total)