Viewing 15 posts - 571 through 585 (of 5,504 total)
Did you try using SUM() OVER()?
SUM(Num) OVER (PARTITION BY Age) AS Ga
SUM(Num) OVER (PARTITION BY Age, D1) AS GaD1
SUM(Num) OVER (PARTITION BY Age, D1, D2) AS GaD1D2
February 25, 2012 at 1:41 pm
Guessing again, it seems like the OP is quite happy with the answer received at msdn
February 25, 2012 at 12:43 pm
Jeff Moden (2/25/2012)
Returning to the original subject of this thread, I can now say I've seen just about everything on this fine forum.http://www.sqlservercentral.com/Forums/Topic1257783-391-1.aspx
<shudder>
It becomes rather scary when seen in context...
February 25, 2012 at 12:17 pm
duplicate post. no replies please. Discussion already started here
February 25, 2012 at 12:06 pm
Please provide table DDL and sample data in a ready to use format as described in the first link in my signature as well as your expceted output based on...
February 25, 2012 at 12:03 pm
I would use a three-step scenario:
Step1: use the DelimitedSplit8K function referenced in my signature with delimiter ','
Step2: using the result set, apply the DelimitedSplit8K function with delimiter '='
Ste3: Use The...
February 25, 2012 at 11:58 am
I'm expecting there's a users table...
SELECT
t2.usr,
SUM (CASE WHEN t1.createdby =t2.usr THEN 1 ELSE 0 END ) AS created,
SUM (CASE WHEN t1.updatedby =t2.usr THEN 1 ELSE 0 END )...
February 25, 2012 at 11:53 am
Another option would be to use a calendar table with the columns you need and join to that table.
A calender table is especially helpful if there are special date ranges...
February 24, 2012 at 6:55 am
ybz199009 (2/24/2012)
blabla
reported as well. There are about 100 of those within the last few hours from the same user. :sick:
February 24, 2012 at 1:31 am
ybz199009 (2/23/2012)
blabla
Spam. Reported
February 24, 2012 at 1:27 am
bcchamberlain (2/23/2012)
February 23, 2012 at 2:55 pm
I didn't try to convert the numeric value to a date value.
But here's my approach:
DECLARE @tbl TABLE
(
ROW_NOINT IDENTITY(1,1),
idINT,
CHECKS INT,
duration INT,
id_date INT
)
INSERT INTO @tbl
VALUES
(85036024,21504,10,40544),
(85036024,4337731,10,40545),
(85036024,269731,10,40548),
(85036024,269731,10,40549),
(85036024,269731,10,40552),
(85036024,21504,10,40553),
(85036024,21504,10,40554),
(85036024,21566,10,40555),
(85036024,21506,10,40556),
(85036024,21506,10,40557),
(97393064,21504,11,40558),
(97393064,21504,10,40562);
WITH cte AS
(
SELECT
*,
ROW_NUMBER() OVER(ORDER BY Row_No)-
ROW_NUMBER()...
February 23, 2012 at 2:47 pm
will it eats the performance
To answer this question:
It depends on the code behind the split function. As long as it is not an in-line-table valued function, the answer most...
February 23, 2012 at 11:34 am
I've been talking about replacing the view with an itvF.
And yes, you can call the itvF with a parameter that is used inside the function.
February 23, 2012 at 11:14 am
Viewing 15 posts - 571 through 585 (of 5,504 total)