Viewing 15 posts - 5,851 through 5,865 (of 10,144 total)
SELECT *
FROM
(SELECT DealerCode FROM Sales GROUP BY DealerCode) m
CROSS JOIN Forecast fc
LEFT JOIN [Sales] s on s.DealerCode = m.DealerCode AND s.ForecastID = fc.ForecastId
ORDER BY m.DealerCode
August 21, 2012 at 5:58 am
SELECT *
FROM D
LEFT OUTER JOIN a
ON A.a = D.a
WHERE
A.b = 1 -- << this turns the LEFT OUTER JOIN into an INNER JOIN
AND D.a IN (1,2,3,4)
-- use this...
August 21, 2012 at 4:41 am
-- The query requires a scan of the whole 100M rows to evaluate the ORDER BY.
-- An index with Destination, Origin, Airline and Tax will help.
-- You *probably* don't need...
August 21, 2012 at 4:01 am
GilaMonster (8/21/2012)
Cursors are tools. Use them where they work, don't use them where they don't. Statements like 'you should never use a <whatever>' are just shortsighted
If we count while loops...
August 21, 2012 at 2:38 am
rhythmk (8/20/2012)
Cliff Jones (8/20/2012)
Scott D. Jacobson (8/20/2012)
SQLRNNR (8/20/2012)
Ray K (8/20/2012)
Manic MondaySusanna Hoffs and Matthew Sweet.
Ming Tea
Green Tea
Green Day
August 21, 2012 at 1:46 am
dwain.c (8/21/2012)
Yesterday I was called upon to...
August 21, 2012 at 1:45 am
Stefan Krzywicki (8/20/2012)
Brandie Tarvin (8/20/2012)
ChrisM@Work (8/17/2012)
Pet rent? Never heard of that over here.
Landlords in the States are adding it to the usual rental fees as a way to discourage pet...
August 21, 2012 at 1:42 am
SELECT -- resolve "word" between 5th and 6th pipe characters using Cascaded (CROSS) APPLY
WordInRow3 = SUBSTRING(row3,r5.p+1,(r6.p-r5.p)-1)
FROM (SELECT Stringy = @text, LineDelimiter = CHAR(13)+CHAR(10)+CHAR(13)+CHAR(10)) d
CROSS APPLY (SELECT p = CHARINDEX(LineDelimiter,Stringy,1)) x1
CROSS...
August 20, 2012 at 5:14 am
SQLRNNR (8/17/2012)
jasona.work (8/17/2012)
Daniel Bowlin (8/17/2012)
bcsims 90437 (8/17/2012)
Cliff Jones (8/17/2012)
ChrisM@Work (8/17/2012)
SQLRNNR (8/17/2012)
behemothTiger moth
Tiger Shark
Shark week!
Pool shark
(Landshark)
Loan Shark - the worst kind.
Interesting
August 20, 2012 at 2:04 am
jfowler 10337 (8/17/2012)
August 20, 2012 at 2:00 am
Stuart Davies (8/17/2012)
ChrisM@Work (8/17/2012)
Stuart Davies (8/17/2012)
ChrisM@Work (8/16/2012)
August 20, 2012 at 1:47 am
jfowler 10337 (8/17/2012)
August 17, 2012 at 9:58 am
jfowler 10337 (8/17/2012)
i just need things grouped by week starting with Monday and ending on Thursday.
There are 13 selects in your query - each one has to be aggregated at...
August 17, 2012 at 9:55 am
jfowler 10337 (8/17/2012)
i just need things grouped by week starting with Monday and ending on Thursday.
No problem.
Run the results into a temp table, index it, and select with an aggregate.
August 17, 2012 at 9:44 am
Viewing 15 posts - 5,851 through 5,865 (of 10,144 total)