Hi all,
I have select statement...
$sql = 'SELECT IF(SUBSTRING(ip.Item, 4, 4)="Room","Room",ip.Item) AS Item';
$sql .= ' FROM `it-pricelist` AS ip';
$sql .= ' GROUP BY Item';
that is grouped by the item column, has a few non unique item values that contain "Room". I'm thinking that using the substring function to trim item field values containing "Room" to contain only "Room" as follows...
'01 Room' -> 'Room'
'02 Room' -> 'Room'
'03 Room' -> 'Room'
'Dryer'
'Vent'
'Dryer'
I want to "GROUP BY item" to get the following...
Room
Dryer
Vent
But i get...
Room
Room
Room
Dryer
Vent
what's wrong?