I need to put in the result field the following value: true / false, depending on whether in the "Lunch" column there is a keyword that can be found in the "Breakfast" column. The expected result is:
WITH Recipes AS
(SELECT 'Blueberry pancakes' as Breakfast, 'Egg salad sandwich' as Lunch UNION ALL
SELECT 'Potato pancakes', 'Toasted cheese sandwich' UNION ALL
SELECT 'Ham scramble', 'Steak avocado salad' UNION ALL
SELECT 'Tomato pasta', 'Tomato soup' UNION ALL
SELECT 'Corned beef hash', 'Lentil potato soup')
SELECT *,
***Field for your code*** result,
FROM Recipes;
Unfortunately the function: contains_substr (Breakfast, 'Tomato pasta') only takes into account one given string, and not all of the strings in the whole "Lunch" column.
Does anyone know how to solve this?
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.