Viewing 15 posts - 1 through 15 (of 92 total)
I apologize for the incorrect explanation. I ran into a problem with this sort of thing about 3 months ago, and I looked all over BOL EXCEPT for the...
December 16, 2009 at 9:20 am
Not sure if it's the best way, but here's my solution:
INSERT INTO #Merch_Act_Total
SELECT [Day]
, SUM( Sales )
, AVG( AvgSale )
, SUM( Goods )
, SUM( Goodsbought )
FROM
( SELECT *
FROM #Merch_Act
UNION ALL
SELECT...
August 17, 2009 at 2:03 pm
Beverley,
I just had a coworker send me this link today - http://www.dailymail.co.uk/news/worldnews/article-1204394/Take-seats--The-jaw-dropping-row-spectacle-wildfire-devours-Canadian-mountains.html And coincidentally, almost immediately after reading the article, I came across this thread. My heart goes...
August 17, 2009 at 1:21 pm
Drew, that last query is beautiful. Kudos to you!
August 12, 2009 at 2:21 pm
drew.allen (8/12/2009)
August 12, 2009 at 1:31 pm
I don't have much experience using PIVOT, but I think Drew's solution will only work if each scout only has two parents. In the case of stepparents, this may...
August 12, 2009 at 8:18 am
I definitely understand that desire, but I don't know of a way to do exactly that. After posting the last query, I realized, too, that there's a more efficient...
August 11, 2009 at 12:07 pm
Just wondering... is there a reason you can't do this?
select distinct id
from #tmp t1
where value = 'Z'
AND id NOT IN
( SELECT t2.id
FROM #tmp t2
WHERE t2.value 'Z'
)
August 11, 2009 at 11:45 am
I don't think we really know enough to help here. We will need CREATE and INSERT statements with sample tables/data to figure out what's wrong. As is, I...
August 11, 2009 at 11:27 am
Assuming this is in a stored proc, I think the easiest way to do what you're asking is as follows:
DECLARE @Result1 INT
DECLARE @Result2 INT
SELECT @Result1 = MAX(p.Col1) - SUM(CASE WHEN...
June 9, 2009 at 6:14 am
gcopeland (1/12/2009)
Jack Corbett (1/12/2009)
January 12, 2009 at 10:34 am
Ken's code looks like it'll work to me based on what we know about the query. You might be getting tripped up because you posted a very small portion...
August 13, 2008 at 9:55 am
I agree that it is a good article. However, if you *have* to use EXEC for whatever reason, you can prevent SQL Injection by just replacing all of your...
August 12, 2008 at 2:01 pm
I've heard far too many negative comments about Vista from friends and family... most of which have never even used it... which just highlights how far it's gone. I...
August 11, 2008 at 5:49 am
Viewing 15 posts - 1 through 15 (of 92 total)