次のコードでビューを作成します
SELECT
CONVERT(NVARCHAR, YEAR(okuma_tarihi)) + 'T1' AS sno,
YEAR(okuma_tarihi) AS Yillar,
SUM(toplam_kullanim_T1) AS TotalUsageValue, 'T1' AS UsageType
FROM
TblSayacOkumalari
GROUP BY
CONVERT(NVARCHAR, YEAR(okuma_tarihi)) + 'T1', YEAR(okuma_tarihi)
UNION ALL
SELECT
CONVERT(NVARCHAR, YEAR(okuma_tarihi)) + 'T2' AS sno,
YEAR(okuma_tarihi) AS Yillar,
SUM(toplam_kullanim_T2) AS TotalUsageValue, 'T2' AS UsageType
FROM
TblSayacOkumalari
GROUP BY
CONVERT(NVARCHAR, YEAR(okuma_tarihi)) + 'T1', YEAR(okuma_tarihi)
UNION ALL
SELECT
CONVERT(NVARCHAR, YEAR(okuma_tarihi)) + 'T3' AS sno,
YEAR(okuma_tarihi) AS Yillar,
SUM(toplam_kullanim_T3) AS TotalUsageValue, 'T3' AS UsageType
FROM
TblSayacOkumalari
GROUP BY
CONVERT(NVARCHAR, YEAR(okuma_tarihi)) + 'T1', YEAR(okuma_tarihi)
CONVERT(nvarchar, YEAR(okuma_tarihi)) + 'T1' AS sno
主キーとして定義したいのですが、それは可能ですか?これが可能である場合、どうすればよいですか?