At 11:52 PM +0900 11/4/09, Dave M G wrote:
MySQL,
This should be a fairly simple question.
I have a table with a bunch of people's names. I want to find people
who's name begins within a certain range of characters.
All names between F and P, for example.
What SELECT statement would I use to
> Or :
> alter table users add first_f_name char(1) not null;
> create index first_f_name_idx on users (first_f_name);
> update users set first_f_name = left(first_name,1);
... and don't forget the trigger on insert, update to keep that new column
always up to date.
Regards,
m.
Or :
alter table users add first_f_name char(1) not null;
create index first_f_name_idx on users (first_f_name);
update users set first_f_name = left(first_name,1);
And not the query will use index.
select username from users where first_f_name between "A" and "B";
--
MySQL General Mailing List
gt; -
> F
> FAA
>
> Regards,
> m.
>
> -Original Message-
> From: Michael Dykman [mailto:mdyk...@gmail.com]
> Sent: 04 November 2009 15:19
> To: Dave M G
> Cc: mysql@lists.mysql.com
> Subject: Re: Alphabetical search to and from
>
> Haven'
sage-
From: Michael Dykman [mailto:mdyk...@gmail.com]
Sent: 04 November 2009 15:19
To: Dave M G
Cc: mysql@lists.mysql.com
Subject: Re: Alphabetical search to and from
Haven't tried this myself, but would this not work while permitting
the index to engage?
select * from country Name between
etween 'F' and 'P';
>
> Regards,
> m.
>
> -Original Message-
> From: Dave M G [mailto:d...@articlass.org]
> Sent: 04 November 2009 14:52
> To: mysql@lists.mysql.com
> Subject: Alphabetical search to and from
>
> MySQL,
>
> This should
Try this:
select * from country where LEFT(Name, 1) between 'F' and 'P';
Regards,
m.
-Original Message-
From: Dave M G [mailto:d...@articlass.org]
Sent: 04 November 2009 14:52
To: mysql@lists.mysql.com
Subject: Alphabetical search to and from
MySQL,
This shoul
Dave M G wrote:
MySQL,
This should be a fairly simple question.
I have a table with a bunch of people's names. I want to find people
who's name begins within a certain range of characters.
All names between F and P, for example.
What SELECT statement would I use to do that?
Thank you for any
MySQL,
This should be a fairly simple question.
I have a table with a bunch of people's names. I want to find people
who's name begins within a certain range of characters.
All names between F and P, for example.
What SELECT statement would I use to do that?
Thank you for any advice.
--
Dave