Re: View select results

2007-05-02 Thread Peter Brawley
>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 y

Re: View select results

2007-05-02 Thread spacemarc
2007/5/2, Peter Brawley <[EMAIL PROTECTED]>: 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, a

Re: View select results

2007-05-02 Thread 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; PB spacemarc wrote: 2007/5/2, Peter Brawley <[EMAIL PROTECTED]>: Works for me. Please post a CREA

Re: View select results

2007-05-02 Thread spacemarc
2007/5/2, Peter Brawley <[EMAIL PROTECTED]>: Works for me. Please post a CREATE TABLE stmt & enough INSERTs to demonstrate the problem. This is the dump (MySQL: 5.0.38): the table is not final version, just to test the query. CREATE TABLE `products` ( `area` varchar(25) NOT NULL, `text` varcha

Re: View select results

2007-05-02 Thread Peter Brawley
>can I obtain a recordset like this? >area1, value_one, thing_one > //, value_two, thing_32 > //, value_three, thing_ dd >area2, value_ten, thing_6w > //, value_ff, thing_l SET @prev=''; SELECT IF(area = @prev, '', @prev := area) AS area, ... other columns ... FROM &c ... PB spacema

Re: View select results

2007-05-02 Thread Baron Schwartz
Hi, spacemarc wrote: Hi my table have three fields that, if selected, are shown like: area1, value_one, thing_one area1, value_two, thing_32 area1, value_three, thing_ dd area2, value_ten, thing_6w area2, value_ff, thing_l can I obtain a recordset like this? area1, value_one, thing_

View select results

2007-05-02 Thread spacemarc
Hi my table have three fields that, if selected, are shown like: area1, value_one, thing_one area1, value_two, thing_32 area1, value_three, thing_ dd area2, value_ten, thing_6w area2, value_ff, thing_l can I obtain a recordset like this? area1, value_one, thing_one //, value_two,