[Beds] Not strictly a linux Q - but...

Anthony Perkins anthony at muzz.co.uk
Tue Nov 1 12:43:34 GMT 2005


Lee,

I believe:

SELECT LEFT(column_name, 100) FROM table_name;

is the function you need.  This will select the first 100 characters
from the specified column.  Similarly, RIGHT(column_name, 100) will
select the last 100 characters.  I cannot verify if this will work in
your version however: I have only used version 4.1.

-Anthony

On 01/11/05, Lee Larcombe <lee at larcombe.uk-internet.org.uk> wrote:
> Hi all
>
> Is there any one out there who can help with a MySQL question???
>
> The question is this: I have a DB record with a text field, but I only want
> to apply a search query to the first paragraph of that field (or say, the
> first 100 words). Is there any way to do this?
>
> I am using MySQL 3.23, so I have fulltext searching, but not boolean mode.
>
> Searching the web and looking at some books has so far resulted in nothing -
> maybe I am not asking the right questions.
>
> Any help would be appreciated.
>
> Thanks
> Lee
>
>
>
> _______________________________________________
> Beds mailing list
> Beds at mailman.lug.org.uk
> http://mailman.lug.org.uk/mailman/listinfo/beds
>


--
"muzz2k"
(Anthony Perkins)
http://muzz.co.uk



More information about the Beds mailing list