Viewing 15 posts - 8,611 through 8,625 (of 10,143 total)
Allan, to reiterate Ade The main question is how do you decide about the order. what do you want the values in the [order] column to be dependant upon?
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
March 31, 2009 at 5:37 am
Reckon Flo's got the nail on the head here - so all we need is some sample data:
DROP TABLE #GroupMembers
CREATE TABLE #GroupMembers (
Group_member_id INT,
Member_id INT,
Group_id INT,
[Order] INT)
INSERT INTO #GroupMembers (Group_member_id,...
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
March 31, 2009 at 4:59 am
mithun.gite (3/31/2009)
but fine,,, i respect u sir....dnt get angry on me....
I m just raising my doubts........
I will check 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
March 31, 2009 at 4:44 am
mithun.gite (3/31/2009)
superb,, now can u tell me if i have used joins of two-three tables , and
then in case statment i m using these tables's columns based...
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
March 31, 2009 at 4:19 am
kinnon_2000 (3/31/2009)
This might be an interesting question.
No kidding, Kinnon!
If these ID's are used by the database and are PK's and FK's, then don't change them - they're there for 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
March 31, 2009 at 4:16 am
mithun.gite (3/31/2009)
I think when u use case in select statement it has to process it row by row just like the function we use....so it might hit the perofrmance...
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
March 31, 2009 at 3:44 am
mithun.gite (3/31/2009)
as per me avoid using cases in select stmt... and better u go with the union all option , i think i would have opted for union all as...
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
March 31, 2009 at 2:28 am
CAST to INT isn't necessary, according to BOL YEAR() "Returns an integer that represents the year of the specified date."
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
March 28, 2009 at 11:19 am
SELECT * FROM tbl WHERE imgdata IS NULL
NULL isn't equal to anything, hence the special operator.
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
March 28, 2009 at 3:39 am
Hi Paul
Quite possibly, but we'll need more information from you. Firstly, let's have a look at the original query. I've added table aliases to make it easier to read, 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
March 28, 2009 at 3:36 am
It helps a lot - if the data doesn't matter to you, then don't use it. Your query will be a lot simpler. Just group by your three required columns.
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
March 27, 2009 at 3:09 pm
Michael Valentine Jones (3/26/2009)
In the spirit of the completely ridiculous, here goes:
Michael you may not have found a par playmate on this one but here's some sealion clapping for originality...
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
March 27, 2009 at 3:04 pm
You're welcome Blanktree, thanks for the feedback.
If you don't already know, TSQL has two flavours of CASE, simple and searched. The query above uses the searched flavour because the conditions...
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
March 27, 2009 at 10:19 am
Spot on. I should have known that you would have tried and covered all bases 😎
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
March 27, 2009 at 9:47 am
Carolyn's got it on the nose. There are two dupe pairs (on capacity, secy_type and record_type) in the sample data:
SELECT '12345678', 'B', '1234', '1', '3A', 'A' UNION ALL --
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
March 27, 2009 at 9:45 am
Viewing 15 posts - 8,611 through 8,625 (of 10,143 total)