2 つのテーブルがあります。
CREATE TABLE [dbo].[Clients](
[ID] [int] IDENTITY(1,1) NOT NULL,
[FIO] [nvarchar](100) NULL,
[HPhone] [nchar](10) NULL,
[MPhone] [nchar](10) NULL,
CONSTRAINT [PK_Clients] PRIMARY KEY CLUSTERED )
CREATE TABLE [dbo].[Payment](
[ID] [int] IDENTITY(1,1) NOT NULL,
[Paid] [decimal](18, 0) NOT NULL,
[date] [date] NULL,
[IDClient] [int] NULL,
CONSTRAINT [PK_Payment] PRIMARY KEY CLUSTERED
)
このデータを構築するための SQL クエリの作成方法:
ID FIO January February March April May etc
--- ------------------ --------- --------- --------- --------- --------- ---------
1 Jimm Salvan 200 200 200 200 NULL etc
2 Bob Dillan 200 200 200 200 NULL etc