[snip] I've a field with www.s.com/p.php?id=3 www.s.com/p.php?id=4 www.s.com/p.php?id=5
if a do a query with the atribute 'group by' i want that the system regroup all that is after the '?' is that possible? SELECT field WHERE all that is after the '?' GROUP BY all that is after the '?' the result should be: www.s.com/p.php [/snip] SELECT substring(field, 1, 15) FROM table WHERE substring(field, 16) = '?' GROUP BY field should return what you have asked for above (www.s.com/p.php). However, if you group by each thing that is after the '?' your result set would be www.s.com/p.php (this group is id=3) www.s.com/p.php (this group is id=4) www.s.com/p.php (this group is id=5) You can also try SELECT substring(field, 1, locate('?', field)-1) FROM table GROUP BY substring(field, locate('?', field)); http://dev.mysql.com/doc/mysql/en/string-comparison-functions.html http://dev.mysql.com/doc/mysql/en/string-functions.html -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]