Viewing 15 posts - 39,466 through 39,480 (of 59,072 total)
Paul White (3/6/2010)
There's a faster method than that in 2005 (and I don't mean CLR):
USE tempdb;
GO
IF OBJECT_ID(N'tempdb..#Binary', N'U')
...
--Jeff Moden
Change is inevitable... Change for the better is not.
March 6, 2010 at 11:11 am
steve-893342 (3/6/2010)
So what do you think folks? Will this one go fast?
Sorry Jeff, no cross joins!
WITH cte1 AS...
--Jeff Moden
Change is inevitable... Change for the better is not.
March 6, 2010 at 9:19 am
Colin-232036 (3/5/2010)
--Jeff Moden
Change is inevitable... Change for the better is not.
March 5, 2010 at 11:28 pm
dba-vb (3/5/2010)
hi,thanks for ur response,
what is "three state logic"?
True, False, and "Unknown".
The real affect of having NULLs in a table is usually (not always) a thing called "Denormalization" and...
--Jeff Moden
Change is inevitable... Change for the better is not.
March 5, 2010 at 11:14 pm
arun.sas (3/5/2010)
Hi Jeff,You are good,
“You are not responsible for what people think about you,
But you are responsible for what you give them to think about you” – Stanley Ferrard.
Heh... thanks...
--Jeff Moden
Change is inevitable... Change for the better is not.
March 5, 2010 at 10:59 pm
Thanks, Arun. You're a gentleman and a scholar especially for giving me the heads up on the OP's additional response.
--Jeff Moden
Change is inevitable... Change for the better is not.
March 5, 2010 at 10:57 pm
steve-893342 (3/5/2010)
Well the TRILLION did run to completion OK. A little over 69 hours which ain't bad for a modest spec VM with only 2GB RAM. ...
--Jeff Moden
Change is inevitable... Change for the better is not.
March 5, 2010 at 10:46 pm
arun.sas (3/5/2010)
Hi Jeff,Thanks,
Follow your suggestion.
Very glad to explained in both the versions.
😀
You bet, Arun. Thanks for the heads up on that post.
--Jeff Moden
Change is inevitable... Change for the better is not.
March 5, 2010 at 10:37 pm
Lynn,
You have 9841 posts (which doesn't include QOD points, etc)... Only 159 more to be only the 4th person (not including Steve) in the history of SSC to break the...
--Jeff Moden
Change is inevitable... Change for the better is not.
March 5, 2010 at 10:13 pm
lmu92 (3/5/2010)
Assuming RowNumber is a normal column the you simply could use the GROUP BY function....
--Jeff Moden
Change is inevitable... Change for the better is not.
March 5, 2010 at 10:02 pm
To learn more about how a Tally table can be used as a set based replacement for certain While Loops, please see the following article...
http://www.sqlservercentral.com/articles/T-SQL/62867/
--Jeff Moden
Change is inevitable... Change for the better is not.
March 5, 2010 at 9:57 pm
On the outside chance that there's anyone out there that thinks this type of thing can't be done in SQL Server 2000...
SELECT original.Col1, original.Col2, original.Col3,
...
--Jeff Moden
Change is inevitable... Change for the better is not.
March 5, 2010 at 9:48 pm
nguyennd (3/5/2010)
I were try this SQL but it complex, any one else?
SELECT
Col1,
Col2,
Col3,
Max(Rnk2) OVER (PARTITION BY Col1) as C_col21,
Max(Rnk3) OVER (PARTITION BY Col1) as C_col31
FROM
(SELECT
...
--Jeff Moden
Change is inevitable... Change for the better is not.
March 5, 2010 at 9:38 pm
mike 57299 (3/5/2010)
Huntington Beach California USAa.k.a. Surf City USA
😀
BWAA-HAA!!! I thought they passed a referendum so that it was against the law to have to work there. 😛
I'll...
--Jeff Moden
Change is inevitable... Change for the better is not.
March 5, 2010 at 9:28 pm
Divide'n'Conquer...
WITH
cteCounts AS
(
SELECT Col1,
COUNT(DISTINCT Col2) AS C_col21,
COUNT(DISTINCT Col3) AS C_col31
...
--Jeff Moden
Change is inevitable... Change for the better is not.
March 5, 2010 at 9:13 pm
Viewing 15 posts - 39,466 through 39,480 (of 59,072 total)