I've table and data as follow,CREATE TABLE [dbo].[JobNotice_DetailRequirement_2_1]( [idx] [int] IDENTITY(1,1) NOT NULL, [JobNoticeID] [int] NULL, [Requirement_Expression] [nvarchar](200) NULL) ON [PRIMARY]GOSET IDENTITY_INSERT [dbo].[JobNotice_DetailRequirement_2_1] ONINSERT [dbo].[JobNotice_DetailRequirement_2_1] ([idx], [JobNoticeID], [Requirement_Expression]) VALUES (1, 78, N'[LevelID]=12 OR')INSERT [dbo].[JobNotice_DetailRequirement_2_1] ([idx], [JobNoticeID], [Requirement_Expression]) VALUES (2, 78, N'[LevelID]=2 and [StudyFieldID]=72 and [CGPA] >=2.00 and [CGPA]<=4.00')INSERT [dbo].[JobNotice_DetailRequirement_2_1] ([idx], [JobNoticeID], [Requirement_Expression]) VALUES (3, 109, N'[LevelID]=20 and [StudyFieldID]=24 and [CGPA] >=2.00 and [CGPA]<=4.00 OR')INSERT [dbo].[JobNotice_DetailRequirement_2_1] ([idx], [JobNoticeID], [Requirement_Expression]) VALUES (4, 109, N'[LevelID]=45')SET IDENTITY_INSERT [dbo].[JobNotice_DetailRequirement_2_1] OFF
I want my output as follow,JobNoticeID | Requirement_Expression--------------------------------------------------78 | [LevelID]=12 OR [LevelID]=2 and [StudyFieldID]=72 and [CGPA] >=2.00 and [CGPA]<=4.00109 | [LevelID]=20 and [StudyFieldID]=24 and [CGPA] >=2.00 and [CGPA]<=4.00 OR [LevelID]=45
How my query looks like?