Viewing 15 posts - 541 through 555 (of 1,182 total)
SELECT
km_ndc
,CASE WHEN SUM(extended_amount_corrected)
+ SUM(qty_corrected)
...
April 23, 2008 at 8:34 am
Not really a better way to write that, but you could replace the AND's with + and test to see the performance difference.
SELECT
km_ndc
,CASE...
April 23, 2008 at 8:14 am
My rulle of thumb is regardless of what "everyone says" is best to run both ways and compare the results. Then you'll know for sure. 😀
April 22, 2008 at 12:35 pm
Matt Miller (4/17/2008)
Try something like this...
select RIGHT('1234567890'+cast(cast(9999999999*rand(checksum(newid())) as bigint) as varchar(10)),10)
OK, that just blows the pants off mine. :hehe:
April 17, 2008 at 10:56 am
Something like this should mix up your numbers ... you may have to run it a couple of times to verify that you get all records.
WITH startingList
AS (SELECT
...
April 17, 2008 at 10:43 am
April 17, 2008 at 7:45 am
Not Arith Abort, but Numeric Round-Abort
April 16, 2008 at 12:43 pm
You have "Numeric Round-Abort" set to True on the 3054 DB. Change it to false and it will run without a hitch.
April 16, 2008 at 11:41 am
That would explain it. It's because you add in another element to the Pivot without aggregating it. You'll need to remove that column from the results or comma delimeted list...
April 10, 2008 at 9:53 am
Read up on NULL in BOL ...
Select Count (Distinct ConsultantID) from @t
Where DeactivationDate = '2007-09-04'
And ISNULL(StatusID, '') <> '72HOURRESIGNATION'
April 10, 2008 at 9:37 am
Really? IT works on my Adventure works DB just fine.
Are you using the EXACT code I posted?
April 10, 2008 at 9:11 am
I hate to be the bearor of bad news Andras, but your query produces a cartesean product. :ermm: Your query returns some 3000 rows, and mine is the original 64....
April 10, 2008 at 7:16 am
You essentially need to run the pivot two seperate times and join on the product name. This may not be the most efficient way of solving your problem, but this...
April 10, 2008 at 7:04 am
Jeff Moden (4/9/2008)
Heh... nice job there "Joel" 😛
Hey, who the heck is this Joel guy? :hehe:
April 10, 2008 at 6:36 am
Viewing 15 posts - 541 through 555 (of 1,182 total)