0

I'm trying to select rows from my database that has over 25 words, but I'm getting an error. What am I doing wrong, and how do I fix it?

SELECT input, LENGTH( input ) - LENGTH( REPLACE( input,  ' ',  '' ) ) +1 num
FROM confused
where num > '25'
LIMIT 0 , 30

Error:

#1054 - Unknown column 'num' in 'where clause' 
frosty
  • 2,559
  • 8
  • 37
  • 73
  • Based on the answer to the other question you asked, do you understand what is wrong here or is it still confusing? – Adish Nov 03 '15 at 01:44
  • I guess he even more confused, as the proposed answer is unrelated to what he asks. The solution: Select * from (Select ... as num from confused) as innerTable where innerTable.num>25 – Antonín Lejsek Nov 03 '15 at 02:47

0 Answers0