This would do it:
SELECT *, LENGTH(Ingredients) - LENGTH(REPLACE(Ingredients, '\n', '')) as Count
FROM Recipes
ORDER BY Count DESC
However, I get the number of lines, it’s a little hack, and I don’t think that there is a better way. I would recommend keeping a column with the number of rows if the performance is huge. However, for medium sized datasets, I believe this should be good.
If you want to have a cache column as described above, you should:
UPDATE
Recipes
SET
IngredientAmount = LENGTH(Ingredients) - LENGTH(REPLACE(Ingredients, '\n', ''))
, , / , (, PHP) . , , triggers.