Page is a not externally linkable
mark_roach - 2:12 pm on Dec 19, 2011 (gmt 0)
If you just want the distinct values then use the DISTINCT keyword and drop the group by.
eg.
$sql = 'SELECT DISTINCT IF(SUBSTRING(ip.Item, 4, 4)="Room","Room",ip.Item) AS Item';
$sql .= ' FROM `it-pricelist` AS ip';
Alternatively if you also want to know how many of each type there are add count(*) to your select statement :
$sql = 'SELECT IF(SUBSTRING(ip.Item, 4, 4)="Room","Room",ip.Item) AS Item, count(*)';
$sql .= ' FROM `it-pricelist` AS ip';
$sql .= ' GROUP BY Item';