I have a function, where a sentance is passed in. I want to pull data only if the word is found in that sentance. Heres what I have:
select
word_data
from words
where
words.word in STRING_SPLIT('Lorem ipsum dolor sit amet.', ' ');
Does anyone know the correct way to do this?
STRING_SPLITreturns a dataset, not a scalar value. It goes in theFROM. Have you read the documentation and its examples? It demonstrates exactly how to do what you're after.'amet.'not'amet'. If you have the word'amet'in your columnwordit will not be matched.