Viewing 15 posts - 781 through 795 (of 1,229 total)
Can you post the actual plan rather than the estimated plan?
December 13, 2011 at 1:11 am
Can you set up a sample table with a few rows of data? The link in my sig will show you how to do this.
December 8, 2011 at 3:10 pm
Have you tried normalising out the first column into two, say in a CTE? If the numeric component is always the first four characters, you could do this easily with...
November 29, 2011 at 11:25 pm
Same as the original, Jeff - CLR. I use T1 at work because the output of Split() is unexpected with delimiters such as ' of '.
FWIW I tried a number...
November 17, 2011 at 11:26 pm
Paul's suggestion of piling tons of rows into the recursive part to speed up counting gave me an idea. Well, two ideas. The first was to minimise the activity of...
November 16, 2011 at 2:26 pm
The Dixie Flatline (11/7/2011)
Because I inadvertantly started (this very entertaining and informative discussion) by making a "suckish" comment, I feel compelled to admit that I have...
November 8, 2011 at 1:07 pm
MyDoggieJessie (11/7/2011)
Hey Sean, does Jeff send you some sort of royalty checks in the mail from time-to-time? 😉(heh, heh)
Read a few of Jeff's articles mate, see for yourself why...
November 7, 2011 at 3:46 pm
Do you see any difference if you change this...
WHERE (Quote.SaleTransferredTS >= '2010-01-01')
GROUP BY LEFT(Comp.CompanyNumber, 6), Comp.CompanyName, Quote.QuoteID,SaleTransferredTS
HAVING LEFT(Comp.CompanyNumber, 6) = '240002')
to...
November 6, 2011 at 1:59 pm
What's wrong with a derived table?
SELECT CompanyName, [Account Number], MIN(Phone) AS Phone,
MIN( Affinity) AS Affinity,MIN(Territory) AS Territory,
MIN(County) AS County,SUM(PriorYear)AS PriorYear, SUM(CurrentYear)AS CurrentYear,
...
November 6, 2011 at 1:55 pm
This should get you started:
-- Create some sample data to play with
DROP TABLE #Fullname
CREATE TABLE #Fullname (ID int identity(1,1), Fullname VARCHAR(50))
INSERT INTO #Fullname (fullname)
SELECT 'Phill R Williams' UNION ALL
SELECT 'P...
November 6, 2011 at 4:48 am
Beginner_2008 (11/5/2011)
After comparing if the two columns...
November 5, 2011 at 4:08 pm
Have you tested the solution I posted yet? There's a reason for choosing SUM() over COUNT(*) which I'm expecting you will have to use.
Oh, and it's all an Illusion...
November 5, 2011 at 1:59 pm
Drop the UNIONs and read the source table only once:
SELECT d.district_nm,
urban_appr = SUM(COUNT_urban_appr),
urban_in = SUM(COUNT_urban_inprogress),
rural_appr = SUM(COUNT_rural_appr),
rural_in = SUM(COUNT_rural_inprogress),
esthal_appr = SUM(COUNT_esthal_appr),
ground_in = SUM(COUNT_esthal_inprogress)
FROM (
SELECT
district_nm,
scheme_type,
COUNT_urban_appr= SUM(CASE WHEN urban_appr IS...
November 5, 2011 at 8:32 am
Here's a few preliminary results from queries posted so far, and another which I'm guessing is Jeff's preaggregate. The preaggregate works fastest but not by a fat lot. I've not...
October 30, 2011 at 3:54 pm
Viewing 15 posts - 781 through 795 (of 1,229 total)