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

Lee Larcombe lee at larcombe.uk-internet.org.uk
Tue Nov 1 13:38:19 GMT 2005


Thanks for the reply.

SELECT LEFT(column_name, 100) FROM table_name; does work for version 3.23. I
can see how I could use this in a nested query such as:

SELECT COUNT(*) FROM newsItem WHERE (text LIKE '%remicade%') AND (text like
'%psoriasis%') IN (SELECT LEFT(text, 100) FROM newsItem WHERE newsType like
'%trials%');

But I don't think this can be done before 4.1? Otherwise I have written this
query incorrectly - what do you think? Or do you have any further
suggestions?

Lee 


On 01/11/05 12:42, "Anthony Perkins" <anthony at muzz.co.uk> wrote:

> 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
> 
> _______________________________________________
> Beds mailing list
> Beds at mailman.lug.org.uk
> http://mailman.lug.org.uk/mailman/listinfo/beds





More information about the Beds mailing list