On Thu, Jul 12, 2001 at 01:52:41PM +0100, Rich Buckley wrote:
> > SELECT MID(email, LOCATE("@", email), 999) AS domain, COUNT(*) FROM
> > email_table GROUP BY domain;
>
> Neat.
>
> > I'm not sure about MID and LOCATE in other renditions of SQL though.
>
> In Oracle MID would be SUBSTR but I cannot think of an alternative
> to LOCATE.
That would be INSTR:
SELECT SUBSTR(email, INSTR(email, '@')), COUNT(*)
FROM email_table
GROUP BY SUBSTR(email, INSTR(email, '@'))
Ronald
- Regexp / Sql-perl problem. Nicolas JOURDEN
- Re: Regexp / Sql-perl problem. Bodo Eing
- RE: Regexp / Sql-perl problem. Rich Buckley
- Re: Regexp / Sql-perl problem. Jon Barker
- RE: Regexp / Sql-perl problem. Rich Buckley
- Re: Regexp / Sql-perl problem. Ronald J Kimball
- Re: Regexp / Sql-perl problem. Nicolas JOURDEN
