Quantcast
Channel: Forum Getting started with SQL Server
Viewing all articles
Browse latest Browse all 7129

Merging Multiple rows into single row

$
0
0

Hello All,

I have a situation where I need to Insert 2 rows(little info from second row) into single row.

Data looks like this:

Date                 Service      CurrMonth  CURR_COUNTS

2016-03-01      Internet     March                    10

2016-04-01      Internet      April                      10

I need a result set in this way: have to show the latest month date and put the Curr month as prev month in single row with corresponding counts.

DATE                  Service                 Current Month     PrevMonth    CURR_M_COUNTS       PREV_M _COUNTS

2016-04-01       Internet                April                     March                       10                              10

Please help.

Thanks


Thanks, Please Help People When they need..!!! Mark as answered if your problem is solved.


Viewing all articles
Browse latest Browse all 7129

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>