Viewing 15 posts - 841 through 855 (of 1,228 total)
info-849042 (5/13/2011)
I have a SQL query, like so:
SELECT DISTINCT ID, Name FROM Table
This brings up all the distinct IDs (1...13), but in the 13 IDs, it repeats the name (as...
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
May 13, 2011 at 4:56 am
Stringzz (5/12/2011)
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
May 13, 2011 at 3:48 am
Duncan Pryde (5/10/2011)
terrykzncs (5/10/2011)
Unfortunately it is a big table. If I use = and put the exact wording will that be faster? I will have to...
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
May 13, 2011 at 3:32 am
SELECT
TEN.[tncy-sys-ref] + CASE
WHEN PER.[GENDER] = 'M' THEN '1' ...
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
May 12, 2011 at 8:56 am
Ryan, can you confirm which version of SQL Server you've been working on please?
Cheers
ChrisM
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
May 12, 2011 at 8:10 am
Dhruva25 (5/6/2011)
select AVG(DATEDIFF(D,DINVPDOF, DOCDATE)), CUSTNMBR from
(select docnumbr,custnmbr,dinvpdof,curtrxam,
( RANK() over (partition by...
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
May 6, 2011 at 1:18 am
buddy__a (5/5/2011)
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
May 5, 2011 at 9:48 am
From Books Online: "CREATE VIEW must be the first statement in a query batch. "
What are you really trying to do by conditionally creating a view?
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
May 5, 2011 at 9:30 am
Mad-Dog (5/5/2011)
CREATE TABLE [dbo].[TBL_REPORT_COLLECT_USERS_CONNECTION](
[RUN_TIME] [datetime] NOT NULL,
[USERS_COUNT] [int] NOT NULL,
[CONNECTION_COUNT] [int] NOT NULL
here is the insert every hour
INSERT INTO TBL_REPORT_COLLECT_USERS_CONNECTION(RUN_TIME,USERS_COUNT,CONNECTION_COUNT)
SELECT GETDATE()AS 'RUN_TIME',COUNT(DISTINCT loginame) AS 'USERS_COUNT',count(spid)AS 'CONNECTIONS_COUNT'
FROM master.sys.sysprocesses...
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
May 5, 2011 at 2:49 am
Did your select look like this:
SELECT field1 = (RIGHT(('00000000' + convert(nvarchar(8), ((SELECT count(*) + 1 FROM table1 o WHERE t.field2 > o. field2 and t.field3 = 'xxx')))),8))
FROM table1 t
WHERE t.field1...
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
May 4, 2011 at 3:22 pm
Gathering information - is it sales for today and the same day last year? If not, please explain in detail.
Do you want sales for this year / last year on...
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
May 4, 2011 at 11:24 am
Tom.Thomson (5/2/2011)
ChrisM@home (5/2/2011)
Koen Verbeeck (5/1/2011)
ChrisM@home (4/30/2011)
LutzM (4/30/2011)
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
May 4, 2011 at 2:52 am
Jeff Moden (5/3/2011)
ChrisM@home (5/3/2011)
Here's another version using APPLY without any sneaky tricks.
Chris, run an estimated execution plan of your code against the following 10,000 rows of data and look at...
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
May 4, 2011 at 2:08 am
Ninja's_RGR'us (5/3/2011)
SQLRNNR (5/3/2011)
WayneS (5/3/2011)
ChrisM@home (5/3/2011)
Jeff, please please please write a book, without changing your style. Give us all an opportunity to repay you for what you've done for us.
+10!
Yes, please...
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
May 3, 2011 at 12:38 pm
Jeff, please please please write a book, without changing your style. Give us all an opportunity to repay you for what you've done for us.
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
May 3, 2011 at 8:06 am
Viewing 15 posts - 841 through 855 (of 1,228 total)