Reputation: 1331
I am trying to come up with a query that will select a row if a column has at least X words in it. For example:
SELECT * FROM TABLE IF COLUMN <has >= 3 words>
Coming up empty though. Any ideas?
Upvotes: 2
Views: 60
Reputation: 204784
3 words need at least 2 spaces. You can count the spaces in your column
select * from your_table
where length(your_column) - length(replace(your_column, ' ', '')) > 1
Upvotes: 5