Viewing 15 posts - 7,261 through 7,275 (of 10,143 total)
Ray K (9/29/2010)
tosscrosby (9/29/2010)
Ray K (9/29/2010)
Cat(as in missing -- he didn't come home last night, which is not like him. Mommy and Daddy are worried.)
Did you do...
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 29, 2010 at 6:55 am
Here's another way, less cluttered. As always, check performance before deciding which solution to use.
; WITH PartitionedData AS (
SELECT ElementCount = COUNT(*) OVER(PARTITION BY column1, column2, column3),
* --...
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 29, 2010 at 6:49 am
Here's the other thread we were all thinking of:
http://www.sqlservercentral.com/Forums/FindPost931414.aspx
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 29, 2010 at 5:52 am
ColdCoffee (9/29/2010)
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 29, 2010 at 5:01 am
Have you tried using CTE's and ROW_NUMBER() for this?
;WITH PartitionedData AS
(SELECT secid, marketCap, tradeDate,
RowID = ROW_NUMBER() OVER(PARTITION BY secid ORDER BY tradeDate DESC)
FROM SecMarketCap
)
SELECT a.secid,
a.tradeDate,
a.marketCap/b.marketCap - 1
FROM PartitionedData...
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 29, 2010 at 3:47 am
Hi ColdCoffee
Funny - I've had to do this recently in a production system but I couldn't find the code or even remember the method. Age sucks.
Here's something which works...
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 29, 2010 at 3:04 am
bcsims 90437 (9/28/2010)
John Rowan (9/28/2010)
IceIce Cream. It's HOT.
Baked Alaska
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 29, 2010 at 2:22 am
Tom.Thomson (9/28/2010)
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 29, 2010 at 2:17 am
Alter this to match your object names, then run it.
If you are experiencing the same problem then it's probably a SP settings issue, check datatype of Col1.
UPDATE dbo.XXX
SET Has_Errors =...
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 28, 2010 at 10:13 am
Ray K (9/28/2010)
Eschew obfuscation
You what????
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 28, 2010 at 9:53 am
Sounds like this to me:
;WITH MyStructuredData AS (
SELECT RowID = ROW_NUMBER() OVER(PARTITION BY PolicyKey, PaymentAmountOriginalCurrency
ORDER BY PolicyKey, PaymentAmountOriginalCurrency, accountspaymentkey),
PolicyKey, PaymentAmountOriginalCurrency, accountspaymentkey
FROM MyTable
)
SELECT
pos.PolicyKey,
pos.accountspaymentkey,
neg.accountspaymentkey,
pos.PaymentAmountOriginalCurrency,
neg.PaymentAmountOriginalCurrency
FROM...
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 28, 2010 at 9:32 am
Paris Hilton
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 28, 2010 at 7:19 am
byrdmom2 (9/28/2010)
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 28, 2010 at 7:00 am
--***get the information from both tables and concatenate date and city
select
t1.eForm53_GUID,
t1.fullname,
convert(varchar(10), b, 101) as RecCreatedDate,
(select convert(varchar(10), b, 101) + ' ' + c as 'data()'
--from...
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 28, 2010 at 6:53 am
Why are you pulling results from your two source tables into table variables before using them in your final query? This is a shedload of extra code (trivial) and could...
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 28, 2010 at 6:44 am
Viewing 15 posts - 7,261 through 7,275 (of 10,143 total)