2007/5/2, Peter Brawley <peter.brawley@stripped>:
> Right, give the computed column an alias differeing from the column name, eg
>
> SET @prev='';
> SELECT
> IF(area = @prev, '', @prev := area) AS AreaHdr,
> text,amount
> FROM products
> ORDER BY area DESC;
ok, now it works! thanks!
One last thing: you set, at first, a parameter called @prev with Null
(' ') value: right?
And, after, you use, instead IF ELSE statement, another syntax: is it
trinary operator? if yes, why it not is in the online MySQL manual?
--
http://www.spacemarc.it