1

I use next query:

SELECT ROUND(r/h) AS conv FROM table WHERE conv > 1

I receive error "Unknown column 'conv' in 'where clause'", But why? After AS conv is it not exists yet?

Grijesh Chauhan
  • 57,103
  • 20
  • 141
  • 208
abdulmanov.ilmir
  • 1,325
  • 4
  • 15
  • 24
  • @Bob's answer shows correct approach, through you may like to try: `SELECT * FROM (SELECT ROUND(r/h) AS conv FROM table) as t1 WHERE conv > 1;` – Grijesh Chauhan Mar 22 '14 at 13:10

1 Answers1

3

The column alias isn't available until results are being produced. Try

SELECT ROUND(R / H) AS CONV
  FROM TABLE1
  WHERE ROUND(R / H) > 1

SQLFiddle here.

Share and enjoy.