Viewing 15 posts - 7,066 through 7,080 (of 10,143 total)
David McKinney (11/12/2010)
Just looking at it, I'd tend to agree with you. While I agree with the assertion that the CTE approach can't benefit from indexes (there are none),...
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
November 12, 2010 at 9:17 am
glyn.walters (11/12/2010)
It's 2005 Express on my dev environment and 2008 in production
Use ROW_NUMBER() like this:
SELECT
Price,
Vendor,
Item,
rn = ROW_NUMBER() OVER(PARTITION BY Item ORDER BY Price, Vendor)
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
November 12, 2010 at 7:18 am
Glyn, what version of SQL Server are you using?
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
November 12, 2010 at 6:53 am
jeff.henrique.tatsoft (11/12/2010)
CREATE TABLE #First (Id INT, [DateTime] numeric(18,0), LogType int, TAGA INT, _TAGA_Q INT, TAGB INT, _TagB_Q INT)
INSERT INTO #First (Id, [DateTime], TAGA, TagA_Qualyty, TAGB, TagB_Qualyty)
SELECT 37,634145506545000000,1,0,192,0,192
Msg 121, Level 15,...
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
November 12, 2010 at 6:46 am
jeff.henrique.tatsoft (11/12/2010)
In the first post I put a simplified example
This table described in XML is First table
The second table is like the first post. I found some difficult ...
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
November 12, 2010 at 6:14 am
It looks a little different to your first post: "The First table is loaded by external software, and i need that after each incert in first table load second table...
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
November 12, 2010 at 5:44 am
Hi Jeff
If possible, can you post a few examples of how the incoming data will look?
Cheers
ChrisM
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
November 12, 2010 at 4:58 am
SET DATEFORMAT DMY
DROP TABLE #First
CREATE TABLE #First (Id INT, [DateTime] DATETIME, TAGA INT, TagA_Qualyty INT, TAGB INT, TagB_Qualyty INT)
INSERT INTO #First (Id, [DateTime], TAGA, TagA_Qualyty, TAGB, TagB_Qualyty)
SELECT 1, '25/11/2010', 6,...
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
November 12, 2010 at 4:20 am
RichardDouglas (11/11/2010)
Juneau
11:11pm? Good Lord Rich, couldn't sleep? 😛
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
November 12, 2010 at 2:13 am
CirquedeSQLeil (11/11/2010)
I have a few articles that I am finishing up currently. Is there anybody that would like to give them a look-over before I submit them?
Go for 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
November 12, 2010 at 2:09 am
WayneS (11/11/2010)
Chris Morris-439714 (11/11/2010)
WayneS (11/10/2010)
Has anyone heard anything about Barry lately?
I had the same thought a couple of weeks ago, but a quick look revealed he'd been quite active, though...
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
November 11, 2010 at 9:41 am
jcrawf02 (11/11/2010)
Craig Farrell (11/10/2010)
Must be the week...http://www.sqlservercentral.com/Forums/Topic1019000-392-1.aspx
Nice sig 😉 To be perfect, should start with "Yea" instead of "'lo", and have an extra thy in "Thy spool and thy...
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
November 11, 2010 at 6:41 am
Your sample data doesn't match your expected output, Karthik.
DROP table #balance_due
create table #balance_due
(
[name] varchar(15),
balance_due_as_on datetime,
Amount float
)
insert into #balance_due
select 'John','11/01/2010',100.25 union all --
select 'John','11/02/2010',100.25 union all --
select 'John','11/03/2010',105.00 union all
select 'John','11/05/2010',200.75...
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
November 11, 2010 at 5:33 am
WayneS (11/10/2010)
Has anyone heard anything about Barry lately?
I had the same thought a couple of weeks ago, but a quick look revealed he'd been quite active, though not on 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
November 11, 2010 at 2:27 am
You're welcome. Thanks for providing enough information to crack the problem.
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
November 10, 2010 at 9:29 am
Viewing 15 posts - 7,066 through 7,080 (of 10,143 total)