HAVING bug in 6.4.2
HAVING bug in 6.4.2
От:
"Oliver Elphick" <olly@lfix.co.uk>
Дата:
HAVING appears not to recognise alias names for columns. Examples: ** Using aggregate in HAVING clause works ** bray=> select p.brand,avg(s.free) as f from product as p, stock as s where p.id = s.product group by p.brand having avg(s.free) > 100; brand | f ------------+---- AVOCA | 660 BULK | 122 ... |5481 (14 rows) ** Using various kinds of column names in HAVING clause does not work ** bray=> select p.brand,avg(s.free) as f from product as p, stock as s where p.id = s.product group by p.brand having f > 100; ERROR: attribute 'f' not found bray=> select p.brand,avg(s.free) as f from product as p, stock as s where p.id = s.product group by p.brand having 2 > 100; brand|f -----+- (0 rows) bray=> select p.brand,avg(s.free) from product as p, stock as s where p.id = s.product group by p.brand having 2 > 100; brand|avg -----+--- (0 rows) Is this a known bug? -- Oliver Elphick Oliver.Elphick@lfix.co.uk Isle of Wight http://www.lfix.co.uk/oliver PGP key from public servers; key ID 32B8FAA1 ======================================== "The heavens declare the glory of God; and the firmament showeth his handiwork." Psalms 19:1