rahman
rahman

Reputation: 4948

sql function to query a Table based on searching a column for a substring

I googled this but couldn't find an easy answer:

I need to write a function that takes a substring as parameter and return those rows which have this substring in a certain column:

select * from myTable where myTable.someColumn contains @substring

appreciate your help thank you

Upvotes: 0

Views: 30

Answers (1)

bitmagier
bitmagier

Reputation: 720

you may use where myTable.someColumn like '%?%' with '@substring' as parameter.

Upvotes: 1

Related Questions