Hi I need to skip rows that may contain text
Example: I have table OUTSTANDING
and my fields are given below.
INVOICENO
AB1
111
ZX3
I need to skip rows contain AB1
and ZX3
and select the row that contain 111
I have tried this query
"SELECT * FROM [INT]..OUTSTANDING WHERE INVOICENO NOT LIKE '%[a-z,-]%'";
Select *
FROM [INT]..OUTSTANDING
WHERE IsNumeric(INVOICENO ) = 1
And INVOICENO Is Not NULL
try with:
"SELECT * FROM [INT]..OUTSTANDING WHERE NOT INVOICENO LIKE '%[0-9]%'";
or
...where INVOICENO not like '%[a-z]%'
unless more advanced regex is required....
source: http://www.sqllion.com/2010/12/pattern-matching-regex-in-t-sql/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With