[英]The string from the Breakfas column is in the Lunch column
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.不幸的是 function: contains_substr (Breakfast, 'Tomato Pasta') 只考虑一个给定的字符串,而不是整个“午餐”列中的所有字符串。
Does anyone know how to solve this?有谁知道如何解决这个问题?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.