Re: SELECT on string field

2005-02-01 Thread Jose Miguel Pérez
Hi Arcangelo! Try this: SELECT COUNT(*), url, SUBSTRING_INDEX(url, "?", 1) AS page_name FROM sites GROUP BY page_name SUBSTRING_INDEX will return the leftmost (or rightmost) part of a string before the ocurrence of a delimiter ("?" in this case. See Documentation:

RE: SELECT on string field

2005-02-01 Thread Jay Blanchard
[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 r

SELECT on string field

2005-02-01 Thread Arcangelo Casavola
Hi, 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

Re: SELECT on string

2004-11-10 Thread Dan Sashko
---+ takes about minute and a half. - Original Message - From: "Michael Stassen" <[EMAIL PROTECTED]> To: "Dan Sashko" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Wednesday, November 10, 2004 6:01 PM Subject: Re: SELECT on string Wha

Re: SELECT on string

2004-11-10 Thread Michael Stassen
What does EXPLAIN SELECT * from rec where string_field='somestring'; say? Michael Dan Sashko wrote: hi i have a recordset of about 4 mil records, SELECT * from rec where string_field="somestring" takes very long time (30+ sec). string_field is indexed MUL. Is there way to make it faster? -- M

SELECT on string

2004-11-10 Thread Dan Sashko
hi i have a recordset of about 4 mil records, SELECT * from rec where string_field="somestring" takes very long time (30+ sec). string_field is indexed MUL. Is there way to make it faster?