I have a select statement
select * from B2B_CardTechCards
where Field NOT LIKE '%-%'
I only want to select the cells that has more than one occurrence of "-" in it. if it occurred once I don't need it.
Simply search for two of them:
select * from B2B_CardTechCards
where Field LIKE '%-%-%'
You can find the count of '-'
in Field
column by using
(len(Field) - len(replace(Field, '-', '')))
Now we can select rows that has the above count value more than one
select *
from B2B_CardTechCards
where (len(Field) - len(replace(Field, '-', ''))) > 1
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