Viewing 15 posts - 16 through 30 (of 53 total)
I'm very thank ful to all .
Its great pleasure to know all the valueable suggestions and solutions.
October 8, 2012 at 5:25 am
thanks jeff for your valuable advice .
I should change the order by n.date final select as below :
SELECT CONVERT(varchar(20), N.date , 101) AS DATECOL, T.WEIGHTS
FROM AllDatesCTE AS N
...
October 7, 2012 at 9:00 pm
Here is the another solution ;
;WITH DigitsCTE AS
(
SELECT digit
FROM (VALUES(0), (1), (2), (3), (4), (5), (6), (7), (8), (9)) AS D(digit)
)
, AllDatesCTE...
October 7, 2012 at 8:41 pm
thanks for all for the valuable different methods . which were really help me to think in different perspectives.
I have gone thorough the all the solutions .
I...
July 22, 2012 at 9:42 pm
Jeff Moden (7/22/2012)
Nagaram (7/22/2012)
Thanks to all ,
There's a question in my mind that's still outstanding about all of this. Do you just want to return a result set or...
July 22, 2012 at 7:21 pm
No because "ROW_NUMBER() OVER (PARTITION BY REFERENCE_ID, TECH_MODE_ID ORDER BY BEGIN_TIME)" will always evaluate to 1 since REFERENCE_ID is the primary key.
SSCrazy,
It will work I think . REFERENCE_ID ...
June 13, 2012 at 11:52 am
Wow .. Thanks.,
This big code working Great .. I will do some testing on this ....
Thanks a lot
June 13, 2012 at 11:35 am
venkat_reddy7 (6/13/2012)
I think you can use below querySELECT REFERENCE_ID
,TECH_MODE_ID
,MIN(BEGIN_TIME)
,MAX(END_TIME)
FROM SAMPLE
GROUP BY
REFERENCE_ID
,TECH_MODE_ID
,CONVERT(VARCHAR(20), BEGIN_TIME, 100)
I think it will not work in all cases .What will happen if I add another...
June 13, 2012 at 11:01 am
I am trying with permutation and combinations ... not yet figure out.
Still trying ..
June 13, 2012 at 10:55 am
I tried this ...
But getting same rank for all TECH_MODE 5, Some where partition is missing .
I am unable figure out it.
SELECT * , DENSE_RANK() OVER(...
June 13, 2012 at 10:33 am
The input data always consistent .
begin_time having incremental date also end_time having incremental date.
I need to group the Consecutive TECH_MODE records by selecting MIN(BEGIN_TIME) , MAX(END_TIME)
-- Output...
June 13, 2012 at 10:12 am
The pattern is consistent ..
Always BEGIN_TIME of records is greater then the END_TIME of previous record.
June 13, 2012 at 10:04 am
Viewing 15 posts - 16 through 30 (of 53 total)