Viewing 3 posts - 1 through 3 (of 3 total)
This is a good way to solve this problem but, it is not giving proper output in all the cases. Execute both the queries with the test data provided above...
July 21, 2011 at 12:02 am
#1356157
Ok, if your requirement is to get data as mentioned above then try below query.
DECLARE @tbl TABLE (Id int identity(1, 1), Name Varchar(100), Date Datetime, Trend varchar(10), Strength varchar(10))
insert into...
July 20, 2011 at 6:41 am
#1355537
Check if below helps you, you can make use of CTE too, but in order to keep it simple I have used an inline query.
DECLARE @tbl TABLE (Name Varchar(10), Date...
July 20, 2011 at 1:26 am
#1355395