Return true/false based on criteria

Hi,

Is there a way to return true if referenced = 00000000-0000-0000-0000-000000000000 otherwise false on distinct productCode?

eg.

OYNPLS000002 True
TESTADDON False
OYNPLS000003 False
USE [GameAPI]
GO
/****** Object:  Table [dbo].[GameBanks]    Script Date: 28.12.2022 16:59:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[GameBanks](
	[GameBankID] [int] IDENTITY(1,1) NOT NULL,
	[referenceId] [uniqueidentifier] NOT NULL,
	[productCode] [nvarchar](max) NULL,
	[quantity] [int] NOT NULL,
	[version] [nvarchar](max) NULL,
	[requestDateTime] [datetime] NULL,
	[customerID] [int] NULL,
	[password] [nvarchar](max) NULL,
	[responseDateTime] [datetime] NULL,
	[initiationResultCode] [nvarchar](max) NULL,
	[companyToken] [nvarchar](max) NULL,
	[used] [int] NOT NULL,
	[productDescription] [nvarchar](max) NULL,
	[currency] [nvarchar](max) NULL,
	[unitPrice] [float] NOT NULL,
	[totalPrice] [float] NOT NULL,
	[ApplicationCode] [nvarchar](max) NULL,
	[estimateUnitPrice] [float] NOT NULL,
	[validatedToken] [nvarchar](max) NULL,
	[signature] [nvarchar](max) NULL,
	[status] [int] NOT NULL,
	[clientTrxRef] [varchar](25) NULL,
 CONSTRAINT [PK_dbo.GameBanks] PRIMARY KEY CLUSTERED 
(
	[GameBankID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
SET IDENTITY_INSERT [dbo].[GameBanks] ON 
GO
INSERT [dbo].[GameBanks] ([GameBankID], [referenceId], [productCode], [quantity], [version], [requestDateTime], [customerID], [password], [responseDateTime], [initiationResultCode], [companyToken], [used], [productDescription], [currency], [unitPrice], [totalPrice], [ApplicationCode], [estimateUnitPrice], [validatedToken], [signature], [status], [clientTrxRef]) VALUES (21217, N'6249cb71-348f-4927-b8fc-9eab93e22c8f', N'OYNPLS000001', 1, N'V1', CAST(N'2021-12-28T08:40:55.833' AS DateTime), NULL, NULL, CAST(N'2021-12-28T08:40:55.833' AS DateTime), NULL, NULL, 0, N'Free Fire 100 + 50 Elmas', N'TRY', 10.25, 10.25, NULL, 0, NULL, N'Cenk', 1, N'0000001')
GO
INSERT [dbo].[GameBanks] ([GameBankID], [referenceId], [productCode], [quantity], [version], [requestDateTime], [customerID], [password], [responseDateTime], [initiationResultCode], [companyToken], [used], [productDescription], [currency], [unitPrice], [totalPrice], [ApplicationCode], [estimateUnitPrice], [validatedToken], [signature], [status], [clientTrxRef]) VALUES (21218, N'dc180d55-bca7-41f3-8449-dc56fce7bc82', N'OYNPLS000002', 1, N'V1', CAST(N'2021-11-28T16:19:59.673' AS DateTime), NULL, NULL, CAST(N'2021-11-28T16:19:59.673' AS DateTime), NULL, NULL, 0, N'Free Fire 210 + 105 Elmas', N'TRY', 20.5, 20.5, NULL, 0, NULL, N'Cenk', 1, NULL)
GO
INSERT [dbo].[GameBanks] ([GameBankID], [referenceId], [productCode], [quantity], [version], [requestDateTime], [customerID], [password], [responseDateTime], [initiationResultCode], [companyToken], [used], [productDescription], [currency], [unitPrice], [totalPrice], [ApplicationCode], [estimateUnitPrice], [validatedToken], [signature], [status], [clientTrxRef]) VALUES (21219, N'd37c6c46-41a0-4d10-95fd-095b97737945', N'OYNPLS000003', 1, N'V1', CAST(N'2021-11-28T16:25:36.997' AS DateTime), NULL, NULL, CAST(N'2021-11-28T16:25:36.997' AS DateTime), NULL, NULL, 0, N'Free Fire 530 + 265 Elmas', N'TRY', 51.25, 51.25, NULL, 0, NULL, N'Cenk', 1, NULL)
GO
INSERT [dbo].[GameBanks] ([GameBankID], [referenceId], [productCode], [quantity], [version], [requestDateTime], [customerID], [password], [responseDateTime], [initiationResultCode], [companyToken], [used], [productDescription], [currency], [unitPrice], [totalPrice], [ApplicationCode], [estimateUnitPrice], [validatedToken], [signature], [status], [clientTrxRef]) VALUES (21220, N'0e85fa18-ce64-4289-900f-6c5935050ee7', N'OYNPLS000004', 1, N'V1', CAST(N'2021-11-28T16:25:35.793' AS DateTime), NULL, NULL, CAST(N'2021-11-28T16:25:35.793' AS DateTime), NULL, NULL, 0, N'Free Fire 1080 + 540 Elmas', N'TRY', 102.5, 102.5, NULL, 0, NULL, N'Cenk', 1, NULL)
GO
INSERT [dbo].[GameBanks] ([GameBankID], [referenceId], [productCode], [quantity], [version], [requestDateTime], [customerID], [password], [responseDateTime], [initiationResultCode], [companyToken], [used], [productDescription], [currency], [unitPrice], [totalPrice], [ApplicationCode], [estimateUnitPrice], [validatedToken], [signature], [status], [clientTrxRef]) VALUES (21221, N'5b28823f-41bb-4ddc-990b-31810deb7b64', N'OYNPLS000005', 1, N'V1', CAST(N'2021-11-28T17:32:56.523' AS DateTime), NULL, NULL, CAST(N'2021-11-28T17:32:56.523' AS DateTime), NULL, NULL, 0, N'Free Fire 2200 + 1100 Elmas', N'TRY', 205, 205, NULL, 0, NULL, N'Cenk', 1, NULL)
GO
INSERT [dbo].[GameBanks] ([GameBankID], [referenceId], [productCode], [quantity], [version], [requestDateTime], [customerID], [password], [responseDateTime], [initiationResultCode], [companyToken], [used], [productDescription], [currency], [unitPrice], [totalPrice], [ApplicationCode], [estimateUnitPrice], [validatedToken], [signature], [status], [clientTrxRef]) VALUES (21222, N'd7f44cba-5a0f-4aba-bbc7-5f40dba75bd2', N'OYNPLS000001', 1, N'V1', CAST(N'2021-12-28T08:41:19.387' AS DateTime), NULL, NULL, CAST(N'2021-12-28T08:41:19.387' AS DateTime), NULL, NULL, 3, N'Free Fire 100 + 50 Elmas', N'TRY', 10.25, 10.25, NULL, 0, NULL, N'Cenk', 2, NULL)
GO
INSERT [dbo].[GameBanks] ([GameBankID], [referenceId], [productCode], [quantity], [version], [requestDateTime], [customerID], [password], [responseDateTime], [initiationResultCode], [companyToken], [used], [productDescription], [currency], [unitPrice], [totalPrice], [ApplicationCode], [estimateUnitPrice], [validatedToken], [signature], [status], [clientTrxRef]) VALUES (21223, N'd0718193-9504-4da7-a774-a0f9df209727', N'OYNPLS000002', 1, N'V1', CAST(N'2021-11-28T16:40:00.700' AS DateTime), NULL, NULL, CAST(N'2021-11-28T16:40:00.700' AS DateTime), NULL, NULL, 0, N'Free Fire 210 + 105 Elmas', N'TRY', 20.5, 20.5, NULL, 0, NULL, N'Cenk', 1, NULL)
GO
INSERT [dbo].[GameBanks] ([GameBankID], [referenceId], [productCode], [quantity], [version], [requestDateTime], [customerID], [password], [responseDateTime], [initiationResultCode], [companyToken], [used], [productDescription], [currency], [unitPrice], [totalPrice], [ApplicationCode], [estimateUnitPrice], [validatedToken], [signature], [status], [clientTrxRef]) VALUES (21224, N'751b7d7a-0def-4978-98f4-063498ff0962', N'OYNPLS000003', 1, N'V1', CAST(N'2021-11-28T17:32:56.383' AS DateTime), NULL, NULL, CAST(N'2021-11-28T17:32:56.383' AS DateTime), NULL, NULL, 0, N'Free Fire 530 + 265 Elmas', N'TRY', 51.25, 51.25, NULL, 0, NULL, N'Cenk', 1, NULL)
GO
INSERT [dbo].[GameBanks] ([GameBankID], [referenceId], [productCode], [quantity], [version], [requestDateTime], [customerID], [password], [responseDateTime], [initiationResultCode], [companyToken], [used], [productDescription], [currency], [unitPrice], [totalPrice], [ApplicationCode], [estimateUnitPrice], [validatedToken], [signature], [status], [clientTrxRef]) VALUES (21225, N'fb39ce90-5d63-4276-b53c-58c49862bee2', N'OYNPLS000004', 1, N'V1', CAST(N'2021-11-28T17:32:54.850' AS DateTime), NULL, NULL, CAST(N'2021-11-28T17:32:54.850' AS DateTime), NULL, NULL, 0, N'Free Fire 1080 + 540 Elmas', N'TRY', 102.5, 102.5, NULL, 0, NULL, N'Cenk', 1, NULL)
GO
INSERT [dbo].[GameBanks] ([GameBankID], [referenceId], [productCode], [quantity], [version], [requestDateTime], [customerID], [password], [responseDateTime], [initiationResultCode], [companyToken], [used], [productDescription], [currency], [unitPrice], [totalPrice], [ApplicationCode], [estimateUnitPrice], [validatedToken], [signature], [status], [clientTrxRef]) VALUES (21227, N'e769bcb2-c8b5-4a7c-918b-9db6abe9f925', N'OYNPLS000001', 1, N'V1', CAST(N'2021-12-28T08:41:24.433' AS DateTime), NULL, NULL, CAST(N'2021-12-28T08:41:24.433' AS DateTime), NULL, NULL, 0, N'Free Fire 100 + 50 Elmas', N'TRY', 10.25, 10.25, NULL, 0, NULL, N'Cenk', 1, NULL)
GO
INSERT [dbo].[GameBanks] ([GameBankID], [referenceId], [productCode], [quantity], [version], [requestDateTime], [customerID], [password], [responseDateTime], [initiationResultCode], [companyToken], [used], [productDescription], [currency], [unitPrice], [totalPrice], [ApplicationCode], [estimateUnitPrice], [validatedToken], [signature], [status], [clientTrxRef]) VALUES (21228, N'00000000-0000-0000-0000-000000000000', N'OYNPLS000002', 1, N'V1', CAST(N'2021-11-28T16:16:59.553' AS DateTime), NULL, NULL, NULL, NULL, NULL, 0, N'Free Fire 210 + 105 Elmas', N'TRY', 20.5, 20.5, NULL, 0, NULL, N'Cenk', 0, NULL)
GO
INSERT [dbo].[GameBanks] ([GameBankID], [referenceId], [productCode], [quantity], [version], [requestDateTime], [customerID], [password], [responseDateTime], [initiationResultCode], [companyToken], [used], [productDescription], [currency], [unitPrice], [totalPrice], [ApplicationCode], [estimateUnitPrice], [validatedToken], [signature], [status], [clientTrxRef]) VALUES (21229, N'12dbe3e1-2a01-4536-b8af-c10a8e302fba', N'OYNPLS000003', 1, N'V1', CAST(N'2022-12-24T17:53:57.130' AS DateTime), NULL, NULL, CAST(N'2022-12-24T17:53:57.130' AS DateTime), NULL, NULL, 0, N'Free Fire 530 + 265 Elmas', N'TRY', 51.25, 51.25, NULL, 0, NULL, N'Cenk', 1, NULL)
GO
INSERT [dbo].[GameBanks] ([GameBankID], [referenceId], [productCode], [quantity], [version], [requestDateTime], [customerID], [password], [responseDateTime], [initiationResultCode], [companyToken], [used], [productDescription], [currency], [unitPrice], [totalPrice], [ApplicationCode], [estimateUnitPrice], [validatedToken], [signature], [status], [clientTrxRef]) VALUES (21230, N'c794dca4-e221-4525-9994-9fd33dd62b26', N'OYNPLS000004', 1, N'V1', CAST(N'2021-11-28T17:32:56.633' AS DateTime), NULL, NULL, CAST(N'2021-11-28T17:32:56.633' AS DateTime), NULL, NULL, 0, N'Free Fire 1080 + 540 Elmas', N'TRY', 102.5, 102.5, NULL, 0, NULL, N'Cenk', 1, NULL)
GO
INSERT [dbo].[GameBanks] ([GameBankID], [referenceId], [productCode], [quantity], [version], [requestDateTime], [customerID], [password], [responseDateTime], [initiationResultCode], [companyToken], [used], [productDescription], [currency], [unitPrice], [totalPrice], [ApplicationCode], [estimateUnitPrice], [validatedToken], [signature], [status], [clientTrxRef]) VALUES (21231, N'00000000-0000-0000-0000-000000000000', N'OYNPLS000005', 1, N'V1', CAST(N'2021-11-28T16:16:59.553' AS DateTime), NULL, NULL, NULL, NULL, NULL, 0, N'Free Fire 2200 + 1100 Elmas', N'TRY', 205, 205, NULL, 0, NULL, N'Cenk', 0, NULL)
GO
INSERT [dbo].[GameBanks] ([GameBankID], [referenceId], [productCode], [quantity], [version], [requestDateTime], [customerID], [password], [responseDateTime], [initiationResultCode], [companyToken], [used], [productDescription], [currency], [unitPrice], [totalPrice], [ApplicationCode], [estimateUnitPrice], [validatedToken], [signature], [status], [clientTrxRef]) VALUES (21232, N'af97173f-f15b-4528-a5f8-ea54ee1464aa', N'OYNPLS000001', 1, N'V1', CAST(N'2022-01-11T20:59:15.307' AS DateTime), NULL, NULL, CAST(N'2022-01-11T20:59:15.307' AS DateTime), NULL, NULL, 0, N'Free Fire 100 + 50 Elmas', N'TRY', 10.25, 10.25, NULL, 0, NULL, N'Cenk', 0, NULL)
GO
INSERT [dbo].[GameBanks] ([GameBankID], [referenceId], [productCode], [quantity], [version], [requestDateTime], [customerID], [password], [responseDateTime], [initiationResultCode], [companyToken], [used], [productDescription], [currency], [unitPrice], [totalPrice], [ApplicationCode], [estimateUnitPrice], [validatedToken], [signature], [status], [clientTrxRef]) VALUES (21233, N'00000000-0000-0000-0000-000000000000', N'OYNPLS000002', 1, N'V1', CAST(N'2021-11-28T17:10:40.260' AS DateTime), NULL, NULL, NULL, NULL, NULL, 0, N'Free Fire 210 + 105 Elmas', N'TRY', 20.5, 20.5, NULL, 0, NULL, N'Cenk', 0, NULL)
GO
INSERT [dbo].[GameBanks] ([GameBankID], [referenceId], [productCode], [quantity], [version], [requestDateTime], [customerID], [password], [responseDateTime], [initiationResultCode], [companyToken], [used], [productDescription], [currency], [unitPrice], [totalPrice], [ApplicationCode], [estimateUnitPrice], [validatedToken], [signature], [status], [clientTrxRef]) VALUES (21234, N'a09afcf7-c4ef-41fd-912b-5f03a4a37eb8', N'OYNPLS000003', 1, N'V1', CAST(N'2022-12-25T07:40:34.173' AS DateTime), NULL, NULL, CAST(N'2022-12-25T07:40:34.760' AS DateTime), NULL, NULL, 0, N'Free Fire 530 + 265 Elmas', N'TRY', 51.25, 51.25, NULL, 0, NULL, N'Cenk', 1, NULL)
GO
INSERT [dbo].[GameBanks] ([GameBankID], [referenceId], [productCode], [quantity], [version], [requestDateTime], [customerID], [password], [responseDateTime], [initiationResultCode], [companyToken], [used], [productDescription], [currency], [unitPrice], [totalPrice], [ApplicationCode], [estimateUnitPrice], [validatedToken], [signature], [status], [clientTrxRef]) VALUES (21235, N'00000000-0000-0000-0000-000000000000', N'OYNPLS000004', 1, N'V1', CAST(N'2021-11-28T17:10:40.260' AS DateTime), NULL, NULL, NULL, NULL, NULL, 0, N'Free Fire 1080 + 540 Elmas', N'TRY', 102.5, 102.5, NULL, 0, NULL, N'Cenk', 0, NULL)
GO
INSERT [dbo].[GameBanks] ([GameBankID], [referenceId], [productCode], [quantity], [version], [requestDateTime], [customerID], [password], [responseDateTime], [initiationResultCode], [companyToken], [used], [productDescription], [currency], [unitPrice], [totalPrice], [ApplicationCode], [estimateUnitPrice], [validatedToken], [signature], [status], [clientTrxRef]) VALUES (21236, N'00000000-0000-0000-0000-000000000000', N'OYNPLS000005', 1, N'V1', CAST(N'2021-11-28T17:10:40.260' AS DateTime), NULL, NULL, NULL, NULL, NULL, 0, N'Free Fire 2200 + 1100 Elmas', N'TRY', 205, 205, NULL, 0, NULL, N'Cenk', 0, NULL)
GO
INSERT [dbo].[GameBanks] ([GameBankID], [referenceId], [productCode], [quantity], [version], [requestDateTime], [customerID], [password], [responseDateTime], [initiationResultCode], [companyToken], [used], [productDescription], [currency], [unitPrice], [totalPrice], [ApplicationCode], [estimateUnitPrice], [validatedToken], [signature], [status], [clientTrxRef]) VALUES (21237, N'88188afb-fd30-4058-8193-892d667b3dea', N'OYNPLS000001', 1, N'V1', CAST(N'2022-03-01T16:26:20.267' AS DateTime), NULL, NULL, CAST(N'2022-03-01T16:26:20.267' AS DateTime), NULL, NULL, 0, N'Free Fire 100 + 50 Elmas', N'TRY', 10.25, 10.25, NULL, 0, NULL, N'Cenk', 1, NULL)
GO
INSERT [dbo].[GameBanks] ([GameBankID], [referenceId], [productCode], [quantity], [version], [requestDateTime], [customerID], [password], [responseDateTime], [initiationResultCode], [companyToken], [used], [productDescription], [currency], [unitPrice], [totalPrice], [ApplicationCode], [estimateUnitPrice], [validatedToken], [signature], [status], [clientTrxRef]) VALUES (21238, N'00000000-0000-0000-0000-000000000000', N'OYNPLS000002', 1, N'V1', CAST(N'2021-11-28T17:10:49.693' AS DateTime), NULL, NULL, NULL, NULL, NULL, 0, N'Free Fire 210 + 105 Elmas', N'TRY', 20.5, 20.5, NULL, 0, NULL, N'Cenk', 0, NULL)
GO
INSERT [dbo].[GameBanks] ([GameBankID], [referenceId], [productCode], [quantity], [version], [requestDateTime], [customerID], [password], [responseDateTime], [initiationResultCode], [companyToken], [used], [productDescription], [currency], [unitPrice], [totalPrice], [ApplicationCode], [estimateUnitPrice], [validatedToken], [signature], [status], [clientTrxRef]) VALUES (21239, N'8df494b6-77ac-491c-9fea-709d13ce5dc7', N'OYNPLS000003', 1, N'V1', CAST(N'2022-12-26T21:51:55.937' AS DateTime), NULL, NULL, CAST(N'2022-12-26T21:51:55.937' AS DateTime), NULL, NULL, 0, N'Free Fire 530 + 265 Elmas', N'TRY', 51.25, 51.25, NULL, 0, NULL, N'Cenk', 1, NULL)
GO
INSERT [dbo].[GameBanks] ([GameBankID], [referenceId], [productCode], [quantity], [version], [requestDateTime], [customerID], [password], [responseDateTime], [initiationResultCode], [companyToken], [used], [productDescription], [currency], [unitPrice], [totalPrice], [ApplicationCode], [estimateUnitPrice], [validatedToken], [signature], [status], [clientTrxRef]) VALUES (21240, N'00000000-0000-0000-0000-000000000000', N'OYNPLS000004', 1, N'V1', CAST(N'2021-11-28T17:10:49.693' AS DateTime), NULL, NULL, NULL, NULL, NULL, 0, N'Free Fire 1080 + 540 Elmas', N'TRY', 102.5, 102.5, NULL, 0, NULL, N'Cenk', 0, NULL)
GO
INSERT [dbo].[GameBanks] ([GameBankID], [referenceId], [productCode], [quantity], [version], [requestDateTime], [customerID], [password], [responseDateTime], [initiationResultCode], [companyToken], [used], [productDescription], [currency], [unitPrice], [totalPrice], [ApplicationCode], [estimateUnitPrice], [validatedToken], [signature], [status], [clientTrxRef]) VALUES (21241, N'00000000-0000-0000-0000-000000000000', N'OYNPLS000005', 1, N'V1', CAST(N'2021-11-28T17:10:49.693' AS DateTime), NULL, NULL, NULL, NULL, NULL, 0, N'Free Fire 2200 + 1100 Elmas', N'TRY', 205, 205, NULL, 0, NULL, N'Cenk', 0, NULL)
GO
INSERT [dbo].[GameBanks] ([GameBankID], [referenceId], [productCode], [quantity], [version], [requestDateTime], [customerID], [password], [responseDateTime], [initiationResultCode], [companyToken], [used], [productDescription], [currency], [unitPrice], [totalPrice], [ApplicationCode], [estimateUnitPrice], [validatedToken], [signature], [status], [clientTrxRef]) VALUES (21242, N'6d5e66e3-e549-4dc0-9b92-a1a96b99ec87', N'TESTADDON', 1, N'V1', CAST(N'2021-12-06T14:39:20.933' AS DateTime), NULL, NULL, CAST(N'2021-12-06T14:39:20.933' AS DateTime), NULL, NULL, 3, N'2100 ZA', N'TRY', 5, 5, NULL, 5, N'f77691bd-8b20-4122-ba04-f9829fabe618 Imported from Service Database', NULL, 0, NULL)
GO
INSERT [dbo].[GameBanks] ([GameBankID], [referenceId], [productCode], [quantity], [version], [requestDateTime], [customerID], [password], [responseDateTime], [initiationResultCode], [companyToken], [used], [productDescription], [currency], [unitPrice], [totalPrice], [ApplicationCode], [estimateUnitPrice], [validatedToken], [signature], [status], [clientTrxRef]) VALUES (21243, N'2b07d734-ee32-4f00-96b7-7f53dec284de', N'TESTADDON', 1, N'V1', CAST(N'2021-12-07T17:28:22.400' AS DateTime), NULL, NULL, CAST(N'2021-12-07T17:28:22.400' AS DateTime), NULL, NULL, 0, N'2100 ZA', N'TRY', 5, 5, NULL, 5, N'9e42c2ca-de8a-4d7c-8b7e-96cba841491d Imported from Service Database', NULL, 1, NULL)
GO
INSERT [dbo].[GameBanks] ([GameBankID], [referenceId], [productCode], [quantity], [version], [requestDateTime], [customerID], [password], [responseDateTime], [initiationResultCode], [companyToken], [used], [productDescription], [currency], [unitPrice], [totalPrice], [ApplicationCode], [estimateUnitPrice], [validatedToken], [signature], [status], [clientTrxRef]) VALUES (21244, N'8931d040-d0ae-4052-ad1e-c8a2c10716ef', N'TESTADDON', 1, N'V1', CAST(N'2021-12-07T17:28:23.463' AS DateTime), NULL, NULL, CAST(N'2021-12-07T17:28:23.463' AS DateTime), NULL, NULL, 0, N'2100 ZA', N'TRY', 5, 5, NULL, 5, N'b555c3f9-693e-4390-9419-39a8d0c56897 Imported from Service Database', NULL, 1, NULL)
GO
INSERT [dbo].[GameBanks] ([GameBankID], [referenceId], [productCode], [quantity], [version], [requestDateTime], [customerID], [password], [responseDateTime], [initiationResultCode], [companyToken], [used], [productDescription], [currency], [unitPrice], [totalPrice], [ApplicationCode], [estimateUnitPrice], [validatedToken], [signature], [status], [clientTrxRef]) VALUES (21245, N'1f7a4484-b494-4804-a023-14a2c398ec49', N'TESTADDON', 1, N'V1', CAST(N'2021-12-07T17:28:23.937' AS DateTime), NULL, NULL, CAST(N'2021-12-07T17:28:23.937' AS DateTime), NULL, NULL, 0, N'2100 ZA', N'TRY', 5, 5, NULL, 5, N'0e4f7623-4dd5-434f-8207-f4763006d3c4 Imported from Service Database', NULL, 1, NULL)
GO
INSERT [dbo].[GameBanks] ([GameBankID], [referenceId], [productCode], [quantity], [version], [requestDateTime], [customerID], [password], [responseDateTime], [initiationResultCode], [companyToken], [used], [productDescription], [currency], [unitPrice], [totalPrice], [ApplicationCode], [estimateUnitPrice], [validatedToken], [signature], [status], [clientTrxRef]) VALUES (21246, N'127b5e4d-19f3-4ab0-a8cd-c3fa3f43d26a', N'TESTADDON', 1, N'V1', CAST(N'2021-12-07T17:28:24.327' AS DateTime), NULL, NULL, CAST(N'2021-12-07T17:28:24.327' AS DateTime), NULL, NULL, 0, N'2100 ZA', N'TRY', 5, 5, NULL, 5, N'ed7adec5-592e-4484-8978-08b9edaa4f8b Imported from Service Database', NULL, 1, NULL)
GO
INSERT [dbo].[GameBanks] ([GameBankID], [referenceId], [productCode], [quantity], [version], [requestDateTime], [customerID], [password], [responseDateTime], [initiationResultCode], [companyToken], [used], [productDescription], [currency], [unitPrice], [totalPrice], [ApplicationCode], [estimateUnitPrice], [validatedToken], [signature], [status], [clientTrxRef]) VALUES (21247, N'd58828d0-7903-4f83-8a7a-25bc45aa4734', N'TESTADDON', 1, N'V1', CAST(N'2021-12-07T17:28:24.717' AS DateTime), NULL, NULL, CAST(N'2021-12-07T17:28:24.717' AS DateTime), NULL, NULL, 0, N'2100 ZA', N'TRY', 5, 5, NULL, 5, N'9250029f-a8c9-4724-9cf4-1a4861c056d8 Imported from Service Database', NULL, 1, NULL)
GO
INSERT [dbo].[GameBanks] ([GameBankID], [referenceId], [productCode], [quantity], [version], [requestDateTime], [customerID], [password], [responseDateTime], [initiationResultCode], [companyToken], [used], [productDescription], [currency], [unitPrice], [totalPrice], [ApplicationCode], [estimateUnitPrice], [validatedToken], [signature], [status], [clientTrxRef]) VALUES (21248, N'29097f06-cf52-46a6-a5e7-f6f68483b1bb', N'TESTADDON', 1, N'V1', CAST(N'2021-12-07T17:28:25.170' AS DateTime), NULL, NULL, CAST(N'2021-12-07T17:28:25.170' AS DateTime), NULL, NULL, 0, N'2100 ZA', N'TRY', 5, 5, NULL, 5, N'e6e4c799-156d-4a9f-88aa-47aee2b99d5e Imported from Service Database', NULL, 1, NULL)
GO
INSERT [dbo].[GameBanks] ([GameBankID], [referenceId], [productCode], [quantity], [version], [requestDateTime], [customerID], [password], [responseDateTime], [initiationResultCode], [companyToken], [used], [productDescription], [currency], [unitPrice], [totalPrice], [ApplicationCode], [estimateUnitPrice], [validatedToken], [signature], [status], [clientTrxRef]) VALUES (21249, N'519268b5-fc26-4682-9592-74a30fa9eb3d', N'TESTADDON', 1, N'V1', CAST(N'2021-12-07T17:28:25.647' AS DateTime), NULL, NULL, CAST(N'2021-12-07T17:28:25.647' AS DateTime), NULL, NULL, 0, N'2100 ZA', N'TRY', 5, 5, NULL, 5, N'223ef5f7-66a0-4ec0-ae2e-6829586237f8 Imported from Service Database', NULL, 1, NULL)
GO
INSERT [dbo].[GameBanks] ([GameBankID], [referenceId], [productCode], [quantity], [version], [requestDateTime], [customerID], [password], [responseDateTime], [initiationResultCode], [companyToken], [used], [productDescription], [currency], [unitPrice], [totalPrice], [ApplicationCode], [estimateUnitPrice], [validatedToken], [signature], [status], [clientTrxRef]) VALUES (21250, N'7263a145-0892-4af0-9bf3-83eb1358be62', N'TESTADDON', 1, N'V1', CAST(N'2021-12-07T17:28:26.160' AS DateTime), NULL, NULL, CAST(N'2021-12-07T17:28:26.160' AS DateTime), NULL, NULL, 0, N'2100 ZA', N'TRY', 5, 5, NULL, 5, N'c4fee5a3-5153-4cbf-87ae-f9484ce75d89 Imported from Service Database', NULL, 1, NULL)
GO
INSERT [dbo].[GameBanks] ([GameBankID], [referenceId], [productCode], [quantity], [version], [requestDateTime], [customerID], [password], [responseDateTime], [initiationResultCode], [companyToken], [used], [productDescription], [currency], [unitPrice], [totalPrice], [ApplicationCode], [estimateUnitPrice], [validatedToken], [signature], [status], [clientTrxRef]) VALUES (21251, N'e9d8acf0-1316-4d29-b7e2-345413354d83', N'TESTADDON', 1, N'V1', CAST(N'2021-12-07T17:28:26.617' AS DateTime), NULL, NULL, CAST(N'2021-12-07T17:28:26.617' AS DateTime), NULL, NULL, 0, N'2100 ZA', N'TRY', 5, 5, NULL, 5, N'5a36c47c-9c5f-4e58-9368-e005fa8d93db Imported from Service Database', NULL, 1, NULL)
GO


SET IDENTITY_INSERT [dbo].[GameBanks] OFF
GO

Not sure what distinct product codes means, but you can use a Case When statement

Case when ReferenceID = '00000000-0000-0000-0000-000000000000' then 0 else 1 end

SELECT ProductCode, 
    MAX(CASE WHEN referenceId = '00000000-0000-0000-0000-000000000000' 
        THEN 'True' ELSE 'False' END) AS [True/False]
FROM GameBanks 
GROUP BY ProductCode
--ORDER BY ProductCode
1 Like