<jm********@infogt2000.comwrote in message
news:11**********************@b28g2000cwb.googlegr oups.com...
I want to do the equivalent of
SELECT id from TABLE WHERE text='text'
only fast solution I found is:
SELECT id,text from TABLE WHERE MATCH(text) AGAINST('value' IN BOOLEAN
MODE) HAVING text='value'
Is there a better way to do that? Cause using having needs me to add a
column in select wich is a problem in some cases.
It has to return the EXACT WORD MATCH. so only rows containing the
exact "value" content in the text column will be returned.
Normally string comparisons are not case sensitive. But you can easily
force a case sensitive comparison using the BINARY keyword:
SELECT 'abc' = 'aBc';
Returns True because it does a case insensitive compare
SELECT BINARY 'abc' = 'aBc';
Returns False because BINARY forces the compare to be case sensitive.
Your example:
SELECT id
FROM TABLE {SomeTable}
WHERE BINARY 'We demand an EXACT match!' = {SomeTextField}
If your text field is char or varchar, you can also give it the field the
BINARY attribute.
This overrides the default, case insensitive, database behaviour for string
comparisons and you can leave out the BINARY keyword from the WHERE. I
don't like this myself. It is non-standard behaviour and I would rather see
the BINARY declared explicitly in the query.
Thomas Bartkus