Quantcast
Channel: SQL Server Database Engine forum
Viewing all articles
Browse latest Browse all 12963

make a table by group by command

$
0
0

hi all freind.

we have a table(

tbl1:

      id int //key

       code nvarchar(6)

       sentdate date

)

we want make a query to show us count of record by this conditioin:

each code appear in only one record(group by code)

and we have 14 column :

code          month1          month2          month3          month4          month5          month6          month7          month8 ......    count

value of month1  is count of redores that code=code and sentdate.month==1 and .......... value of count is all record by code=code .

please help us.

thanks.          


Viewing all articles
Browse latest Browse all 12963

Trending Articles



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