Hi,

Tim's point is that you have someone with a last name of 'zebra', they won't be 
included in your results.

Quentin

-----Original Message-----
From: Paul Nowosielski [mailto:[EMAIL PROTECTED]
Sent: Saturday, 22 July 2006 7:19 a.m.
To: mysql@lists.mysql.com
Cc: Tim Lucia
Subject: Re: Searching through an alphabetical range


Its working fine for me:

mysql> SELECT DISTINCT email_address FROM mailing_list WHERE marketing_list 
LIKE 'Y' AND last_name >= 'm' AND last_name <= 'z';

26371 rows in set (1.00 sec)

Thank You,

-- 
Paul Nowosielski
Webmaster



On Friday 21 July 2006 12:46, Tim Lucia wrote:
> Not quite...
>
> mysql> select 'zebra' >= 'm' AND 'zebra' <= 'z';
> +-----------------------------------+
>
> | 'zebra' >= 'm' AND 'zebra' <= 'z' |
>
> +-----------------------------------+
>
> |                                 0 |
>
> +-----------------------------------+
> 1 row in set (0.00 sec)
>
> mysql> select 'seal' >= 'm' AND 'seal' <= 'z';
> +---------------------------------+
>
> | 'seal' >= 'm' AND 'seal' <= 'z' |
>
> +---------------------------------+
>
> |                               1 |
>
> +---------------------------------+
> 1 row in set (0.00 sec)
>
> mysql>
>
> 'zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz' will probably do the trick, though.
>
> Tim
>
> > -----Original Message-----
> > From: Paul Nowosielski [mailto:[EMAIL PROTECTED]
> > Sent: Friday, July 21, 2006 2:10 PM
> > To: mysql@lists.mysql.com
> > Subject: Re: Searching through an alphabetical range
> >
> >
> > I have the solution:
> >
> >
> > SELECT DISTINCT email_address FROM mailing_list WHERE last_name >= 'm'
> > AND last_name <= 'z'
> >
> > Thank you,
> >
> > --
> > Paul Nowosielski
> > Webmaster
> >
> > On Friday 21 July 2006 11:03, Paul Nowosielski wrote:
> > > Dear All,
> > >
> > > I need to write a query that searches last names between the ranges of
> > > m through z.
> > >
> > > Is there a way to do this in the query?
> > >
> > >
> > > Thank You,
> > >
> > > --
> > > Paul Nowosielski
> > > Webmaster
> > > office: 303.440.0666 ext 219
> > > cel: 303.827.4257
> >
> > --
> > MySQL General Mailing List
> > For list archives: http://lists.mysql.com/mysql
> > To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]
The information contained in this email is privileged and confidential and
intended for the addressee only. If you are not the intended recipient, you
are asked to respect that confidentiality and not disclose, copy or make use
of its contents. If received in error you are asked to destroy this email
and contact the sender immediately. Your assistance is appreciated.

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to