Viewing 15 posts - 7,816 through 7,830 (of 10,143 total)
Two different solutions.
-- query 1
SELECT o.id, o.first, o.last, o.person_id, o.id_master
FROM (
SELECT d.id, d.first, d.last, d.person_id, d.id_master,
x = COUNT(*) OVER (PARTITION BY d.person_id)
FROM #duplicates d
INNER JOIN #blacklist...
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 14, 2010 at 4:34 am
Please provide scripts to create all three tables and populate the source table with 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
June 14, 2010 at 4:07 am
CREATE TABLE ##a(id int identity(0,2))
INSERT INTO ##a DEFAULT VALUES
INSERT INTO ##a DEFAULT VALUES
INSERT INTO ##a DEFAULT VALUES
INSERT INTO ##a DEFAULT VALUES
SELECT * FROM ##a
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 14, 2010 at 4:05 am
Matt Mitchell (6/13/2010)
Matt Mitchell (6/12/2010)
Gets my vote!The question does highlight thebenegits of stating the problem in English though.
and also the benefits of reading what you've put before posting!
Lol!
Shame 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 14, 2010 at 3:34 am
The sample data is a little late but never mind - what are the column names?
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 11, 2010 at 4:09 am
lart.expert (6/11/2010)
Is it me, or does this look like a homework question?
Unlikely as OP has been a forum member for over two years.
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 11, 2010 at 3:52 am
DROP TABLE #test
CREATE TABLE #test
(
IdX INT,
IdY INT,
...
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 11, 2010 at 3:09 am
DROP TABLE #Table
CREATE TABLE #Table (A INTEGER)
INSERT INTO #Table (A)
SELECT 1 UNION ALL SELECT 2 UNION ALL SELECT 3 UNION ALL SELECT 4
SELECT *
FROM #Table
ORDER BY
CASE
WHEN A...
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 11, 2010 at 2:58 am
skcadavre (6/8/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
June 8, 2010 at 9:06 am
GilaMonster (6/8/2010)
Scott-144766 (6/7/2010)
Sadly, tuberculosis isn't a thing of the past like smallpox. It infects a third of the world's population and kills over a million people a year.
In some parts...
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 8, 2010 at 8:27 am
If you have to aggregate your results, and I'm sure you do given the number of rows you're processing, then GROUP BY is almost certainly the fastest way to do...
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 8, 2010 at 7:23 am
tosscrosby (6/8/2010)
mbricker-600840 (6/8/2010)
WhirligigDid you know they could be "hand or friction" powered? :w00t: I don't even want to know......
Hand or friction powered aquatic beetle?
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 8, 2010 at 7:02 am
Gopi Muluka (6/8/2010)
DECLARE @Table1 TABLE (ID INT , Employee VARCHAR(50))
DECLARE @Table2 TABLE (SourceFieldChar CHAR(1),Val CHAR(1) )
INSERT INTO @Table1
SELECT 1,'Ritesh' UNION ALL
SELECT 2, 'Bhatt'
INSERT INTO @Table2
SELECT 'R','X' UNION ALL
SELECT 'i',...
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 8, 2010 at 6:17 am
The best way? Impossible to tell from what you've provided. Which output columns do you want, and from which tables? Build a SELECT...FROM...with a modest restriction and test it. Look...
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 8, 2010 at 5:44 am
This should get you started:
DROP TABLE #TABLE1
CREATE TABLE #TABLE1 (ID INT, EmployeeName VARCHAR(20)) -- see SELECT TOP 20 in CROSS APPLY
INSERT INTO #TABLE1 (ID, EmployeeName)
SELECT 1, 'Ritesh' UNION ALL
SELECT 2,...
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 8, 2010 at 5:31 am
Viewing 15 posts - 7,816 through 7,830 (of 10,143 total)