Viewing 15 posts - 6,676 through 6,690 (of 10,143 total)
gcresse (9/6/2011)
This works fantastic with the test data! Thanks for your efforts. Now I will see if I can make it work with my actual tables.
I had actually...
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
September 7, 2011 at 1:46 am
maruthipuligandla (9/6/2011)
...Any update on the query? ...
Nope, still waiting for usable sample data scripts.
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
September 6, 2011 at 6:56 am
steveb. (9/6/2011)
SELECT CASE WHEN Cast(0 AS bit) = NULL THEN 1...
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
September 6, 2011 at 5:44 am
maruthipuligandla (9/6/2011)
Hi,I've generated scripts with data for 4 tables, please find the attached sql script files..
The image columns aren't required for this exercise, take up an inordinate amount of space,...
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
September 6, 2011 at 4:20 am
maruthipuligandla (9/6/2011)
Hi,I didnt get what exactly you asking me for? Should i send scripts for 3 tables with data or what?...
Four tables. If you take the time to read 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
September 6, 2011 at 4:03 am
maruthipuligandla (9/6/2011)
Please find the sample data screen attached herewith from CandidateInterview table, where we can see the no:of candidates applied for a job for particular status..
Please supply DDL and DML...
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
September 6, 2011 at 3:50 am
Here's a mod which works across different products with different numbers of ingredients:
USE tempdb
GO
CREATE TABLE Transactions(
trnKey ...
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
September 5, 2011 at 10:06 am
kramaswamy (9/2/2011)
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
September 5, 2011 at 4:34 am
gcresse (9/1/2011)
I forgot to mention in my original post that the product is liquid and stored 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
September 5, 2011 at 4:19 am
mattech06 (9/1/2011)
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
September 1, 2011 at 8:58 am
Here's the simplest most basic script which makes a lot of assumptions:
SELECT
p.dbPatCnt,
p.dbPatFirstName,
p.dbPatLastName,
f.dbPhoneNumber,
f.dbPhoneTypeID
FROM Patients p
INNER JOIN LnkPhone l ON l.dbKeyCnt = p.dbPatCnt
INNER JOIN Phone f ON...
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
September 1, 2011 at 8:27 am
lalit.madan (7/19/2011)
/*this behaves like inner join*/select * from freight_manager
cross apply LargeOrderShippers ( freight_manager.min_value, freight_manager.max_value)
/*this behaves like cross join*/
select * from freight_manager
outer apply LargeOrderShippers ( freight_manager.min_value, freight_manager.max_value)
🙂
I think you will find...
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
September 1, 2011 at 7:25 am
Here's another way:
SELECT
question,
Answer,
answereddate,
accredappid
FROM (
SELECT
question,
Answer,
answereddate,
accredappid,
AnswerCount = COUNT(*) OVER (PARTITION BY accredappid, question)
FROM answers
) d
WHERE AnswerCount > 1
ORDER BY accredappid, question
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
September 1, 2011 at 4:08 am
The calculations in your spreadsheet appear to be incorrect, this is what I think it should look like:
[font="Courier New"]
Ingr Pct Ingr...
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
September 1, 2011 at 3:33 am
Cadavre (8/31/2011)
Nice one Chris 😉Told you someone would simplify it Greg
Wonder if it works on the real data though?
My money's on CC's script, it's more flexible 😎
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
August 31, 2011 at 9:44 am
Viewing 15 posts - 6,676 through 6,690 (of 10,143 total)