Viewing 15 posts - 6,211 through 6,225 (of 10,144 total)
dwain.c (6/22/2012)
When I posted the article, Jeff took a shot at...
June 22, 2012 at 3:28 am
dwain.c (6/22/2012)
If you were right though, does that mean my version is 3125x...
June 22, 2012 at 2:46 am
dwain.c (6/22/2012)
-- Original
(115681 row(s) affected)
SQL Server...
June 22, 2012 at 2:37 am
dwain.c (6/22/2012)
...Sorry, I don't get it. Are you talking my query here or yours?
Yours:
SELECT 1, Tuples = CAST(Prod AS VARCHAR(8000)), value
FROM @t
UNION ALL
SELECT n.n+1, t.Prod + ',' + n.Tuples,...
June 22, 2012 at 2:02 am
dwain.c (6/21/2012)
ChrisM@Work (6/21/2012)
Dwain's code, incidentally, is a flash of genius. It runs 2,500 times faster than mine, because it only works with the rows it has to.
Wow Chris! That's...
June 22, 2012 at 1:45 am
jeffem (6/21/2012)
June 21, 2012 at 8:30 am
jeffem (6/21/2012)
ChrisM@Work (6/21/2012)
David Webb-200187 (6/19/2012)
Let's say you had 50 rows, all with a quantity of 1. The target quantity was 5.
How would you want that brought back? All...
June 21, 2012 at 7:36 am
David Webb-200187 (6/19/2012)
Let's say you had 50 rows, all with a quantity of 1. The target quantity was 5.
How would you want that brought back? All the possible...
June 21, 2012 at 6:13 am
farooq.hbs (6/21/2012)
My Metric Values returning two times Lyk
IsNUll(Sum(Case When Datepart(year,mdate)= 2011 and mt.item_name = 'Hard Savings' then m.value End),0) as HardSavingFY11,
IsNull(Sum(Case When Datepart(year,mdate)= 2012...
June 21, 2012 at 1:41 am
You don't need dynamic SQL for this:
SELECT NewColumn
= CAST(Col1 AS VARCHAR(10)) + ' - '
+ CAST(Col2 AS VARCHAR(10)) + ' - '
+ CAST(Col3 AS VARCHAR(10))...
June 20, 2012 at 6:52 am
Since GENERAL_COMMODITY_CD table has a different cardinality to your result set, having multiple rows per BOOKING_ID, you will need to preaggregate it, either as a CROSS APPLY or as a...
June 20, 2012 at 6:35 am
pwalter83 (6/20/2012)
ChrisM@Work (6/20/2012)
Are you seeing one row per BOOKING_ID in your output?- here's where adequate sample data would have helped 🙂
yeah, I get only one row per BOOKING_ID and...
June 20, 2012 at 5:51 am
Are you seeing one row per BOOKING_ID in your output?
- here's where adequate sample data would have helped 🙂
June 20, 2012 at 5:33 am
pwalter83 (6/20/2012)
---------------------------------
CROSS APPLY (
SELECT
=
STUFF(
(SELECT ', ' + mbc.GENERAL_COMMODITY_CD...
June 20, 2012 at 5:18 am
Thanks Paul: try this...
SELECT
MB.BOOKING_ID,
BOOKING_NUM,
--------------------------------------------------------
a.[BOOKING EQUIPMENT],
--------------------------------------------------------
GENERAL_COMMODITY_CD + ',' AS GENERAL_COMMODITY_CD -- qualify this column with a table alias so others know which table it's from
FROM MG_BOOKING MB
LEFT JOIN (
SELECT
BOOKING_ID,...
June 20, 2012 at 4:42 am
Viewing 15 posts - 6,211 through 6,225 (of 10,144 total)