Viewing 15 posts - 7,786 through 7,800 (of 10,143 total)
Have a look at the output from the following query.
I reckon you're looking for all rows where [source] = 0, and also all rows where the value of 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
June 18, 2010 at 2:39 am
dbowlin (6/17/2010)
Excelsior!
Fat Freddy's Cat.
Fertility Pills!
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
June 18, 2010 at 2:06 am
This should give you a few ideas
DROP TABLE #TABLE_A
CREATE TABLE #TABLE_A (DEl_No VARCHAR(6), L_Amt INT, T_Amt INT, A_Name VARCHAR(6))
INSERT INTO #TABLE_A (DEl_No, L_Amt, T_Amt, A_Name)
SELECT '087NT1', 24000, 28699, 'Physic'...
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
June 17, 2010 at 10:18 am
delwarinc (6/17/2010)
thanks for your reply, please can you show how to do this
Of course!
You will have to write this bit though - Write a query to retrieve the ingredient...
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
June 17, 2010 at 9:30 am
Unreserved apologies, jvanderberg, for appearing shallow - however the remark passes the logic test. It appears your employers have no intention of raising your salary at the current threat level:...
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
June 17, 2010 at 8:23 am
jcrawf02 (6/17/2010)
Chris Morris-439714 (6/17/2010)
Before Sing4you whines "Not Yet" and Jason protests "Wasn't me!", this is about football and not pregnancy, right? 😀You mean Hand-Egg?
Jon, you always lower the tone of...
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
June 17, 2010 at 7:54 am
jvanderberg (6/17/2010)
What do you think I should do?--J
Resign from BP and get a job with TexasOil.
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
June 17, 2010 at 7:53 am
Before Sing4you whines "Not Yet" and Jason protests "Wasn't me!", this is about football and not pregnancy, right? 😀
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
June 17, 2010 at 7:40 am
This looks too simplistic to be a real world problem.
Step by step:
Write a query to retrieve the ingredient rows of the recipe which you are cloning.
Hard-code the new RecipeID into...
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
June 17, 2010 at 7:32 am
-- query 1
SELECT
MyString,
--CHARINDEX('_', MyString),
--SUBSTRING(MyString, CHARINDEX('_', MyString)+1, LEN(MyString)),
--CHARINDEX('_', SUBSTRING(MyString, CHARINDEX('_', MyString)+1, LEN(MyString))),
MySubstring = LEFT(SUBSTRING(MyString, CHARINDEX('_', MyString)+1, LEN(MyString)),
CHARINDEX('_', SUBSTRING(MyString, CHARINDEX('_', MyString)+1, LEN(MyString)))-1)
FROM ( -- sample data
SELECT '00_MECH_UG' AS MyString...
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
June 17, 2010 at 6:06 am
Hello
There are at least three methods for deriving a running total:
1. Triangular join, as you are attempting here
2. Recursive CTE
3. Quirky update
Method 1 is not recommended as it performs poorly...
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
June 17, 2010 at 4:47 am
How long does the select part SELECT
a.policy,
a.form,
a.date,
SUM(a.premium/b.premprcnt) AS premium
FROM b
INNER JOIN a
ON b.policy = a.policy
AND b.form = a.form
AND b.date = a.date
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
June 17, 2010 at 4:10 am
Here's why I asked - a simple and fast way to get your results:
;WITH Sourcedata AS (
SELECT SubID = ROW_NUMBER() OVER (PARTITION BY ID ORDER BY OLD_VAL),
ID, OLD_VAL, NEW_VAL
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
June 17, 2010 at 2:57 am
Hi Daniel
In your sample data, you have two rows in table #VAL for each row in your update target table. Is this always the case? What's the maximum number of...
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
June 17, 2010 at 2:31 am
Robocat.
Kills 99.9% of all known rodents.
Doesn't dig small holes in your neighbour's herbaceous border.
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
June 17, 2010 at 2:06 am
Viewing 15 posts - 7,786 through 7,800 (of 10,143 total)