troubleshooting Question

SQL Server Find Number between slashes and return only records that match

Avatar of Wayne Barron
Wayne BarronFlag for United States of America asked on
Microsoft SQL ServerSQL
6 Comments1 Solution203 ViewsLast Modified:
OK
SqL Server 2016

This is the scenario.

Table1 has the following.

TabID, Title, GID
The GID Column has the following values. (They differ tremendously through the table)

GID Values

1/2/3/
1/3/5/
3/5/4/9/
33/7/3/11/
1/5/9/23/
8/4/5/2/33/11/
etc...

OK, I need to do a search for all the records of a given number.
So, if I search for
GID = 3
It should only give me back all records that match "3" and NOT "33"
If I search for
GID = 1
It should only give me back all records that match "1" and NOT "11"
And the same goes for search for
GID = 11
It should only give me back all records that match "11" and NOT "111"

Thanks.
Wayne
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 6 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 6 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros