Quantcast
Viewing all articles
Browse latest Browse all 20625

Re: Help with SQL query

If you're wanting to find This:

 

CID34000 Shaynet 1000000

 

But not this:

 

CID34000 Shaynet 34000

 

Then you'll want to do something like this:

 

Select InterfaceAlias, CircuitID

FROM Interfaces

Where CircuitID is not null

AND Patindex('%' + CircuitID + '%' ,InterfaceAlias) = 0

 

You may need to cast/convert CircuitID depending on datatype....

 

You can also add other clauses to narrow down your search at your preference such as:

AND InterfaceAlias LIKE '%CID% (from your original query)


Viewing all articles
Browse latest Browse all 20625

Trending Articles