From: Peter Brawley Date: May 2 2007 7:49pm Subject: Re: View select results List-Archive: http://lists.mysql.com/mysql/206526 Message-Id: <4638EB2D.9080100@earthlink.net> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit >One last thing: you set, at first, a parameter called @prev with Null >(' ') value: right? No, I set it to a string containing one space char. Use anything that does not occur as data in the column. >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? I used the IF() function, see 'Control Flow Functions' under 'Functions and Operators' in the manual PB ------ spacemarc wrote: > 2007/5/2, Peter Brawley : >> 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? >