I have a SQL Column with the following values
ReportID
--------
19
19,20,21
20,19,21
20,21,19
119,21
1191,21
I need to match the the rows which have 19 as a value (i.e. reject last two rows)
Is there a better way to do this than the query used below ? (Using combined regex)
My Query:
SELECT *
FROM [StoreBI_Validation].[dbo].[PortalNotifications]
WHERE ReportID like '%,19,%'
or ReportID like '19'
or ReportID like '19,%'
or ReportID like '%,19'
,20,19,21,then you using%,19,%is enough