Viewing 15 posts - 8,641 through 8,655 (of 10,143 total)
dji (3/26/2009)
I have copied the code and will have a play around as I really do need to get on top of T-SQL instead of writing apps...
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 26, 2009 at 5:41 am
Here's a simple way of doing it:-- set up some sample data
DROP TABLE #MstHorse
CREATE TABLE #MstHorse (HorseID INT, HorseName VARCHAR(30))
INSERT INTO #MstHorse (HorseID, HorseName)
SELECT 1, 'Red Rum' 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
March 26, 2009 at 5:31 am
Here's the old-fashioned way:
DROP TABLE #temp
CREATE TABLE #temp ([pk id] INT, numero INT, statut INT, majdate DATETIME)
INSERT INTO #temp
([pk id], numero, statut, majdate)
SELECT 2480, 202, 0, '2009-03-26 08:15:55.00' 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 26, 2009 at 4:19 am
Some of your commas are a little random. Try the first query, if this works, try the second.
SELECT *
FROM OPENROWSET('SQLNCLI',
'Server= anyserver;Trusted_Connection=yes; Initial Catalog=anydb',
'SELECT GETDATE()')
SELECT *
FROM OPENROWSET('SQLNCLI',
'Server= anyserver;Trusted_Connection=yes; Initial...
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 26, 2009 at 4:09 am
Why not do this client-side? It's formatting, after all.
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 26, 2009 at 3:41 am
musab (3/26/2009)
I am using data type nvarchar(max) and have 13 million records and want to get unique records out of it based on the text.
but the query...
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 26, 2009 at 3:35 am
christophe.bernard (3/26/2009)
pk id numero ...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 26, 2009 at 3:31 am
Can you post the code for the procedure please?
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 25, 2009 at 6:52 am
Kit G (3/24/2009)
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 25, 2009 at 1:48 am
munderhill73525 (3/24/2009)
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 24, 2009 at 8:22 am
Lynn Pettis (3/24/2009)
Is it me or are the people we are trying to help just getting dumber, or do we need to start commenting are code a lot more heavily?
Hell...
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 24, 2009 at 8:16 am
Kit G (3/24/2009)
Roy Ernest (3/24/2009)
The chance of meeting anyone from THE THREAD is very remote for me since 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
March 24, 2009 at 8:09 am
It seems you're confusing "group the employees together by some attribute" (which you would achieve with ORDER BY) with sql GROUP BY, which is something quite different - usually used...
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 24, 2009 at 8:06 am
Select Last_name,Salary,EE01_Classification
FROM Employees
WHERE Salary IN (SELECT Salary
FROM Employees
GROUP BY EE01_Classification,Salary)
ORDER BY EE01_Classification;
This means:
Select Last_name,Salary,EE01_Classification
FROM Employees
WHERE Salary IN (all employee salaries)
ORDER BY EE01_Classification;
Which is the same as:
Select Last_name,Salary,EE01_Classification
FROM Employees
WHERE 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
March 24, 2009 at 7:42 am
foxjazz (3/23/2009)
Take a look at the code posted above, and work it as setbased. Should be simple...
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 23, 2009 at 11:28 am
Viewing 15 posts - 8,641 through 8,655 (of 10,143 total)