Viewing 15 posts - 4,171 through 4,185 (of 10,144 total)
What other columns do you need from this table?
August 12, 2013 at 6:28 am
Stefan_G (8/12/2013)
avdhut.k (8/12/2013)
I mean Now rest of the things are correct in my requirement,
Now, In case where for two records, if ...
August 12, 2013 at 6:23 am
SELECT
tr.*,
ISNULL(nr.c2 - tr.c2,0)
FROM #t1 tr
OUTER APPLY (
SELECT TOP 1 *
FROM #t1 ti
WHERE ti.c1 > tr.c1
ORDER BY ti.c1 ASC
) nr
August 12, 2013 at 5:48 am
SELECT
NDCNumber,
IngredientCost = CAST(CASE
WHEN Trailer IN ('{','A','B','C','D','E','F','G','H','I')
THEN LEFT(ingredientcost,LEN(ingredientcost)-1) + CAST(CHARINDEX('{','{ABCDEFGHI')-1 AS VARCHAR(1))
WHEN Trailer IN ('J','K','L','M','N','O','P','Q','R','}')
THEN '-' + LEFT(ingredientcost,LEN(ingredientcost)-1) + '1'
END AS MONEY)/100
FROM ...
August 12, 2013 at 5:42 am
Can you post the actual plan please Mike? There may well be scope for improving the index.
August 12, 2013 at 5:32 am
I'd guess you have used a recursive cte to generate this data. It would help if you were to post the rCTE query and perhaps some sample data to run...
August 12, 2013 at 5:12 am
What do you mean by "in the exact order"? If the first three rows are nominated by a particular order then it would be more efficient to return the remaining...
August 12, 2013 at 5:09 am
The main query filters on trans_class and posted, the subquery doesn't, which would make using ROW_NUMBER quite tricky.
I'd go for a new (covering) index to support the subquery, something...
August 12, 2013 at 4:58 am
DECLARE @Outstanding DECIMAL(10,2) = 2333.12
;WITH Tens AS (SELECT n = 0 FROM (VALUES (0),(0),(0),(0),(0),(0),(0),(0),(0),(0)) t (n)),
iTally AS (SELECT n = 0 FROM Tens a, Tens b, Tens c, Tens...
August 12, 2013 at 4:20 am
T.Ashish (8/12/2013)
declare @image1imagedeclare @text1text
declare @ntext1ntext
declare @varchar2varchar
declare @nvarchar2nvarchar
declare @varbinary2varbinary
declare @varchar1varchar(max)
declare @nvarchar1nvarchar(max)
declare @varbinary1varbinary(max)
First three variable declarations are definitely going to produce an error.
Yes of course they will. But this won't:
declare @image1varbinary(max)
declare @text1varchar(max)
declare...
August 12, 2013 at 4:00 am
T.Ashish (8/11/2013)
Text, Ntext, and Image data types are invalid for local variables.
Gosh, where did you read that?
August 12, 2013 at 2:26 am
It might be easier for us to understand if you can describe how the result set from my query is different to what you want.
August 12, 2013 at 2:07 am
Jeff Moden (8/10/2013)
Brandie Tarvin (8/2/2013)
How many SQL Spackle articles are there?
Yes, I have a reason for asking. But I...
August 12, 2013 at 1:56 am
Stefan Krzywicki (8/9/2013)
L' Eomot Inversé (8/9/2013)
ChrisM@Work (8/9/2013)
dwain.c (8/9/2013)
ChrisM@Work (8/9/2013)
August 12, 2013 at 1:47 am
L' Eomot Inversé (8/9/2013)
ChrisM@Work (8/9/2013)
dwain.c (8/9/2013)
ChrisM@Work (8/9/2013)
Port Moresby - ranked 139th of 140 cities for liveability, whatever that means. I wonder which city came last? What's the grub like?
Food's OK....
August 12, 2013 at 1:46 am
Viewing 15 posts - 4,171 through 4,185 (of 10,144 total)