Viewing 15 posts - 5,281 through 5,295 (of 10,143 total)
L' Eomot Inversé (1/31/2013)
BrainDonor (1/30/2013)
jasona.work (1/30/2013)
Now, you want a topic that would *really* generate some responses, start a Star Trek vs Star Wars topic,Babylon 5 or nothing.
Blake's 7 was better....
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
January 31, 2013 at 6:36 am
Bhuvnesh (1/31/2013)
ChrisM@Work (1/31/2013)
MAX() OVER (PARTITION BY...) might be more appropriate.New to me 🙂
From BOL [Aggregate Functions (Transact-SQL)]: "The OVER clause may follow all aggregate functions except CHECKSUM."
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
January 31, 2013 at 1:54 am
dwain.c (1/30/2013)
ScottPletcher (1/30/2013)
No, no syntax errors per se, but that method's not guaranteed to work safely either.
Scott - Can you explain this?
I understand that ordering may be an issue. ...
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
January 31, 2013 at 1:35 am
Bhuvnesh (1/31/2013)
Using ROW_NUMBER() with PARTITION .See http://msdn.microsoft.com/en-us/library/ms186734.aspx
MAX() OVER (PARTITION BY...) might be more appropriate.
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
January 31, 2013 at 1:06 am
Chad Crawford (1/30/2013)
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
January 31, 2013 at 12:59 am
Mr. Kapsicum (1/30/2013)
...i want my query to use BOTH ISNULL and COALESCE...
Only homework would impose such a restriction.
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
January 30, 2013 at 5:55 am
How many rows in the table? How many rows are you returning? If you are returning more than say 25%* of the rows in the table, SQL Server may calculate...
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
January 29, 2013 at 9:32 am
chandan_jha18 (1/29/2013)
ChrisM@Work (1/29/2013)
chandan_jha18 (1/29/2013)
...Though it may sound simple, I need to find out why. Please come up with your inputs.
Take away the unnecessary tables and use variables in the exact...
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
January 29, 2013 at 6:20 am
chandan_jha18 (1/29/2013)
...Though it may sound simple, I need to find out why. Please come up with your inputs.
Take away the unnecessary tables and use variables in the exact same way:
DECLARE...
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
January 29, 2013 at 6:06 am
Abu Dina (1/28/2013)
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
January 28, 2013 at 8:35 am
Is it a "fixed" list? I guess what I mean by that is - would it be useful to you to have a function which contained the list definition, rather...
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
January 28, 2013 at 8:21 am
zahid_7777 (1/28/2013)
nchar
Thanks.
WHERE RIGHT(ACTCODE,3) <> '000'
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
January 28, 2013 at 5:20 am
What datatype is actcode?
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
January 28, 2013 at 1:45 am
-- This looks correct:
SELECT
ERP_ID,
customer_number,
ANNUAL_CONTRACT_PRICE,
[Rank]
FROM (
SELECT
ERP_ID,
customer_number,
ANNUAL_CONTRACT_PRICE,
ROW_NUMBER() OVER (PARTITION BY customer_number ORDER BY ANNUAL_CONTRACT_PRICE DESC) AS [Rank]
FROM EMEA_SERVICEMAX.Servicemax.SERVICE_CONTRACTS_STG
WHERE CONTRACT_START_DATE >= GETDATE()-730
AND CONTRACT_STATUS_DESCRIPTION NOT IN ('Free','Canceled','Cancelled')
) a
WHERE a.[rank]...
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
January 28, 2013 at 1:21 am
Thanks for the sample data. Try this:
-- Sample data
DROP TABLE [dbo].[MisIcg_InteractionChecks]
CREATE TABLE [dbo].[MisIcg_InteractionChecks](
[SourceID] [varchar](3) NOT NULL,
[MisIcgID] [varchar](30) NOT NULL,
[InteractionID] [varchar](25) NOT NULL,
[RowUpdateDateTime] [datetime] NULL,
[InteractionCheckMedication] [varchar](2)...
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
January 25, 2013 at 8:17 am
Viewing 15 posts - 5,281 through 5,295 (of 10,143 total)