Viewing 15 posts - 4,996 through 5,010 (of 10,143 total)
vahid.arr (3/22/2013)
SELECT datediff(HOUR,[EnterTime],[ExitTime] )*30 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
March 22, 2013 at 5:51 am
Evil Kraig F (3/21/2013)
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 22, 2013 at 5:38 am
It's down to an optimisation introduced in SQL Server2005 often called "Deferred expression evaluation". Here's a great article by Paul White to add to others already posted.
The original "failing" 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 22, 2013 at 4:43 am
knakka 14475 (3/21/2013)
Hi ChrisM@Work thank you for the reply.. I have one question in case they are more than 100 quanties what do I need to do.
;WITH
-- Make an inline...
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 21, 2013 at 10:27 am
Declare @OrigTab Table(Part varchar(30), qty int)
insert into @OrigTab
select 'X51','3' union
select 'A5','1' union
select '123','2' union
select '054','5'
select * from @OrigTab ORDER BY 1 DESC
;WITH
-- Make an inline tally table (CTE)
E1(N) AS...
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 21, 2013 at 10:04 am
Stefan Krzywicki (3/21/2013)
L' Eomot Inversé (3/21/2013)
dwain.c (3/20/2013)
Lynn Pettis (3/20/2013)
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 21, 2013 at 9:30 am
karthik M (3/21/2013)
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 21, 2013 at 3:02 am
The spec isn't entirely clear; does this generate the results you're expecting to see?
SELECT b.*, a.*, x.*
FROM TableB b
LEFT JOIN TableA a ON b.ColId = a.Area
LEFT JOIN TableA x...
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 20, 2013 at 10:31 am
DECLARE @SomeDate CHAR(8) = '0'
SELECT
ISDATE(@SomeDate),
CAST(NULLIF(@SomeDate,'0') AS DATE)
-- similar to this handy trick:
DECLARE @numerator INT = 1, @denominator INT = 0
SELECT @numerator/@denominator
--Msg 8134, Level 16, State 1, Line 3
--Divide...
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 20, 2013 at 8:39 am
homebrew01 (3/19/2013)
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 20, 2013 at 7:56 am
bugg (3/20/2013)
ChrisM@Work (3/20/2013)
Add column [status] to the include list for index IX_sessionid.As an aside, you appear to have a fair amount of duplication in your indexes.
Thanks for that suggestion.
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
March 20, 2013 at 7:29 am
Jeff Moden (3/20/2013)
Shanmuga Raj (3/20/2013)
Thanks.. its working !can you let me know why you have used
HAVING COUNT(*) = 4
That's to make it so that only those product_ids that...
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 20, 2013 at 7:22 am
Add column [status] to the include list for index IX_sessionid.
As an aside, you appear to have a fair amount of duplication in your indexes.
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 20, 2013 at 6:22 am
Shanmuga Raj (3/20/2013)
when i run the below query i get errorConversion failed when converting the varchar value ' | | |0|0|0' to data type int.
...
Ah, that's because I 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 20, 2013 at 4:45 am
Post the ddl (the CREATE TABLE script) for table fact_sales.
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 20, 2013 at 3:52 am
Viewing 15 posts - 4,996 through 5,010 (of 10,143 total)