例を追加して変更する必要があります。は、どのように私は私の構文が 'WHERE' 節
SELECT s.title, t.description,
u1.value * s.cache_value as Cache,
u2.value * s.drive_value as Drive,
u3.value * s.error_value as Error,
u3.value * s.error_value + u3.value * s.error_value as ErrorHigh,
u3.value * s.error_value - u3.value * s.error_value as ErrorLow,
m.area
FROM storage s
JOIN status t on t.id = s.status_id
JOIN manufac m on m.id = s.area
JOIN unit u1 on s.cache_unit_id = u1.id
JOIN unit u2 on s.drive_unit_id = u2.id
JOIN unit u3 on s.error_unit_id = u3.id
望ましい目標:
SELECT s.title, t.description,
u1.value * s.cache_value as Cache,
u2.value * s.drive_value as Drive,
u3.value * s.error_value as Error,
u3.value * s.error_value + u3.value * s.error_value as ErrorHigh,
u3.value * s.error_value - u3.value * s.error_value as ErrorLow,
m.area
FROM storage s
JOIN status t on t.id = s.status_id
JOIN manufac m on m.id = s.area
JOIN unit u1 on s.cache_unit_id = u1.id
JOIN unit u2 on s.drive_unit_id = u2.id
JOIN unit u3 on s.error_unit_id = u3.id
WHERE 123 BETWEEN ErrorHigh AND ErrorLow;
MySQLの返し構文エラー不明列ErrorHigh
注:ErrorHigh
と 'ErrorLow`は、計算された値を表示するために作成する新しい列です
はhttp://stackoverflow.com/questions/9197215/fighting-inner-join-unknown-column-when-trying-を見ます対処 - 反復 - 保存関数/ 9197376#9197376 – Kaii