Let's say I have a column called 'code' in my database table containing string data types.
I want a query that will return all rows with a 'code' value that is a substring of a given search string, with the added condition that the substring appears at the end of the search string.
For example, if the search string is '12345', the query should return all rows with a 'code' value of:
12345
2345
345
45
5
Simply use like operator:
SELECT * from yourtable
where '12345' like '%' || Code
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