ValiDraganescu
5/22/2019 - 8:39 AM

select rows where text has more than x words

very usefull to find the number of occurences of a characther in a given column. In this case I count the number of spaces to find how many words there are in a column.

select ed.id, ed.originalText, ed.originalLang, ed.translatedText, (LENGTH(ed.originalText) - LENGTH(REPLACE(ed.originalText, ' ', ''))) as 'space_count' from `english-dictionary` ed
having space_count < 5;