Frage

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?

War es hilfreich?

Lösung

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.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top