15,013
edits
| Line 106: | Line 106: | ||
# if the column name 'xxx' was combined by the [http://dev.mysql.com/doc/refman/5.7/en/example-user-variables.html User-Defined Variables]. Enclosed the whole query into another parent derived query. | # if the column name 'xxx' was combined by the [http://dev.mysql.com/doc/refman/5.7/en/example-user-variables.html User-Defined Variables]. Enclosed the whole query into another parent derived query. | ||
<pre> | <pre> | ||
-- query which met | -- The query which met the error message: [Err] 1054 - Unknown column 'rank' in 'where clause' | ||
SELECT semi.*, IF(semi.id = semi.prev, @rank := @rank +1, @rank := 1 ) AS `rank` | SELECT semi.*, IF(semi.id = semi.prev, @rank := @rank +1, @rank := 1 ) AS `rank` | ||
FROM | FROM | ||