Salut le forum;
j'ai une table avec une colonne 'PIDSizeID' 'AchatClient' PID représente la colonne PID dans la table produit SizeID représente la colonne SizeID de la table Size.
Nom : recuperationdonnees.PNG
Affichages : 616
Taille : 146,3 Ko
je voudrais récupéré de façons séparé les données des colonnes 'PID' et 'SizeID' par une requête select. est ce que c'est possible? si oui comment faire?
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[tblPurchase](
	[PurchaseID] [bigint] IDENTITY(49,1) NOT NULL,
	[UserID] [int] NULL,
	[PIDSizeID] [nvarchar](max) NULL,
	[CartAmount] [money] NULL,
	[CartDiscount] [money] NULL,
	[TotalPayed] [money] NULL,
	[PaymentType] [nvarchar](50) NULL,
	[PaymentStatus] [nvarchar](50) NULL,
	[DateOfPurchase] [datetime] NULL,
	[Name] [nvarchar](max) NULL,
	[Address] [nvarchar](max) NULL,
	[PinCode] [nvarchar](50) NULL,
	[MobileNumber] [nvarchar](50) NULL,
PRIMARY KEY CLUSTERED 
(
	[PurchaseID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
 
GO
SET IDENTITY_INSERT [dbo].[tblPurchase] ON 
 
INSERT [dbo].[tblPurchase] ([PurchaseID], [UserID], [PIDSizeID], [CartAmount], [CartDiscount], [TotalPayed], [PaymentType], [PaymentStatus], [DateOfPurchase], [Name], [Address], [PinCode], [MobileNumber]) VALUES (49, 2, N'10010-10006,10010-10006', 2299.0000, 1400.0000, 899.0000, N'Paytm', N'NotPaid', CAST(N'2020-06-21 20:45:15.873' AS DateTime), N'ffdsf', N'fdf', N'5465+', N'4556546')
INSERT [dbo].[tblPurchase] ([PurchaseID], [UserID], [PIDSizeID], [CartAmount], [CartDiscount], [TotalPayed], [PaymentType], [PaymentStatus], [DateOfPurchase], [Name], [Address], [PinCode], [MobileNumber]) VALUES (50, 3, N'10012-10010,10011-10008', 19598.0000, 2900.0000, 16698.0000, N'Paytm', N'NotPaid', CAST(N'2020-12-29 06:55:13.110' AS DateTime), N'', N'', N'', N'')
INSERT [dbo].[tblPurchase] ([PurchaseID], [UserID], [PIDSizeID], [CartAmount], [CartDiscount], [TotalPayed], [PaymentType], [PaymentStatus], [DateOfPurchase], [Name], [Address], [PinCode], [MobileNumber]) VALUES (51, 3, N'10012-10010,10011-10008,10012-10010,10013-10008', 52197.0000, 5000.0000, 47197.0000, N'Paytm', N'NotPaid', CAST(N'2020-12-29 14:32:30.687' AS DateTime), N'Djouontu Rodrigue', N'Douala', N'12345', N'681888316')
INSERT [dbo].[tblPurchase] ([PurchaseID], [UserID], [PIDSizeID], [CartAmount], [CartDiscount], [TotalPayed], [PaymentType], [PaymentStatus], [DateOfPurchase], [Name], [Address], [PinCode], [MobileNumber]) VALUES (52, 4, N'10013-10007,10010-10006,10013-10007', 52299.0000, 3400.0000, 48899.0000, N'Paytm', N'NotPaid', CAST(N'2020-12-29 19:43:55.523' AS DateTime), N'Massigne Diane', N'DOUALA BOJONGO', N'4545', N'681888316')
SET IDENTITY_INSERT [dbo].[tblPurchase] OFF
ALTER TABLE [dbo].[tblPurchase]  WITH CHECK ADD  CONSTRAINT [ FK_tblPurchase_ToUsers] FOREIGN KEY([UserID])
REFERENCES [dbo].[Users] ([Uid])
GO
ALTER TABLE [dbo].[tblPurchase] CHECK CONSTRAINT [ FK_tblPurchase_ToUsers]
GO