List:General Discussion« Previous MessageNext Message »
From:spacemarc Date:May 2 2007 7:35pm
Subject:Re: View select results
View as plain text  
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
Thread
View select resultsspacemarc2 May
  • Re: View select resultsBaron Schwartz2 May
  • Re: View select resultsPeter Brawley2 May
Re: View select resultsspacemarc2 May
Re: View select resultsPeter Brawley2 May
  • Re: View select resultsspacemarc2 May
    • Re: View select resultsPeter Brawley2 May