Viewing 15 posts - 8,146 through 8,160 (of 10,143 total)
djbuzz (2/5/2010)
This query does not work in my SQL 2008 Server:
SELECT dbo.ip2Tags.ip, dbo.ip2Tags.MediaId
FROM dbo.ip2Tags LEFT OUTER JOIN
...
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
February 5, 2010 at 7:15 am
Paul White (2/3/2010)
Mark-101232 (2/3/2010)
Might be of interesthttps://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=318084
Hi Paul
This has turned out to be a real can of worms. I couldn't see anything wrong using the example code and data...
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
February 5, 2010 at 5:43 am
Andeavour (2/4/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
February 5, 2010 at 2:04 am
sgmunson (2/4/2010)
row_number() does not get properly evaluated - it's as if it gets a fresh evaluation from scratch for each row in the iteration
But what if it's correctly "evaluating" only...
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
February 4, 2010 at 7:23 am
Paul White (2/3/2010)
Mark-101232 (2/3/2010)
Might be of interesthttps://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=318084
Thanks for posting this, Paul, it's made for a very interesting lunchtime.
If you add a third anchor row, like this...
with T(i, rn, lvl)...
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
February 4, 2010 at 7:17 am
The lvl value should be 3 where the parentid value is 3. The windowing function worked fine, but the lvl increment in the recursive part of the CTE didn't.
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
February 3, 2010 at 10:24 am
Mark-101232 (2/3/2010)
Might be of interesthttps://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=318084
Thanks for this, Mark. Interesting note - the example query actually does run in compatibility 100 mode.
Edit: On second thoughts, that's quite scary, expecially considering 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
February 3, 2010 at 8:56 am
Might have a play with this at home tonight, it looks promising. This method works as a single-query solution but it looks horrible.
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
February 3, 2010 at 8:09 am
Hi Steve
As promised.
Here's the multistatement code:
-- create table for results
CREATE TABLE #Iteration (PreferenceId INT, BoxId INT, BallId INT)
-- four iterations to solve:
INSERT INTO #Iteration
SELECT PreferenceId, BoxId, BallId
FROM ( -- x
SELECT...
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
February 3, 2010 at 2:28 am
<<limit the recursive selection to rows that aren't already in our selection>>
Hi Steve
I'm not sure a recursive CTE will easily lend itself to this, because what your recursive query 'sees'...
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
February 2, 2010 at 10:05 am
Matt Miller (#4) (2/1/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
February 2, 2010 at 7:03 am
Nabha (1/27/2010)
Not sure if I am missing something here but isnt it the same query that was posted earlier hereI guess discussion was already started there!
Guess the OP didn't like...
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 27, 2010 at 8:11 am
Jpotucek (1/27/2010)
so how do I get my query to actually populate History_YN with either blank, Y or N?
Take it out of the WHERE clause. You must have had it in...
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 27, 2010 at 7:59 am
klineandking (1/27/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
January 27, 2010 at 7:48 am
Jpotucek (1/27/2010)
SELECT a.Contact_info,b.MEMBER_NUMBER
,c.CLIENT_NUMBER
,a.CONTACT_TYPE_ID
,a.history_YN
FROM FRATERNAL.CONTACTS a
inner join FRATERNAL.CLIENT_CONTACTS a1 on a.CONTACT_ID = a1.CONTACT_ID
inner join FRATERNAL.MEMBER b on a1.CLIENT_ID = b.CLIENT_ID
inner join FRATERNAL.CLIENT c on a1.CLIENT_ID = c.CLIENT_ID
WHERE a.CONTACT_TYPE_ID in ('Email1')
AND...
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 27, 2010 at 7:36 am
Viewing 15 posts - 8,146 through 8,160 (of 10,143 total)