Still is not clear, but i've made an example.
I use
PIVOT[
^] statement to count.
Copy below code into MS SQK Managment Studio and paste into new query, than run.
IF NOT OBJECT_ID(N'#Weather') IS NULL
DROP TABLE #Weather
CREATE TABLE #Weather ([SID] VARCHAR(30), [TimeOfDay] VARCHAR(30), [Weather] VARCHAR(30))
INSERT INTO #Weather ([SID] , [TimeOfDay], [Weather] )
VALUES('Europe','Morning','Rainfall')
INSERT INTO #Weather ([SID] , [TimeOfDay], [Weather] )
VALUES('Europe','Afternoon','Sun')
INSERT INTO #Weather ([SID] , [TimeOfDay], [Weather] )
VALUES('Europe','Evening','Dew Cover')
INSERT INTO #Weather ([SID] , [TimeOfDay], [Weather] )
VALUES('Europe','Morning','Sun')
INSERT INTO #Weather ([SID] , [TimeOfDay], [Weather] )
VALUES('Europe','Afternoon','Sun')
INSERT INTO #Weather ([SID] , [TimeOfDay], [Weather] )
VALUES('Europe','Evening','Rainfall')
INSERT INTO #Weather ([SID] , [TimeOfDay], [Weather] )
VALUES('Europe','Morning','Dew Cover')
INSERT INTO #Weather ([SID] , [TimeOfDay], [Weather] )
VALUES('Asia','Morning','Sun')
INSERT INTO #Weather ([SID] , [TimeOfDay], [Weather] )
VALUES('Asia','Afternoon','Sun')
INSERT INTO #Weather ([SID] , [TimeOfDay], [Weather] )
VALUES('Asia','Evening','Rainfall')
INSERT INTO #Weather ([SID] , [TimeOfDay], [Weather] )
VALUES('Asia','Morning','Sun')
INSERT INTO #Weather ([SID] , [TimeOfDay], [Weather] )
VALUES('Asia','Afternoon','Sun')
INSERT INTO #Weather ([SID] , [TimeOfDay], [Weather] )
VALUES('Asia','Evening','Rainfall')
INSERT INTO #Weather ([SID] , [TimeOfDay], [Weather] )
VALUES('Asia','Morning','Dew Cover')
DECLARE @cols VARCHAR(200)
DECLARE @dt VARCHAR(400)
DECLARE @pt VARCHAR(1000)
SET @cols = '[Dew Cover],[Rainfall],[Sun]'
SET @dt = 'SELECT * ' +
'FROM #Weather '
SET @pt = 'SELECT [SID], [TimeOfDay], ' + @cols + ' ' +
'FROM (' + @dt + ') AS DT ' +
'PIVOT (COUNT([Weather]) FOR [Weather] IN(' + @cols + ')) AS PT ' +
'ORDER BY PT.[SID]'
EXEC( @pt)
DROP TABLE #Weather
If you have any question, call ;)