AND statement fails where each works individually
I have a table (ENGINE=NDB) where the primary key is 'szId VARCHAR(85) CHARSET ascii PRIMARY KEY'.
I use to store failed login details where the key is e.g. '192.168.0.3' or '192.168.0.3&Fred'.
I need to find all the records beginning e.g. '192.168.0.3'.
"SELECT * FROM Tbl WHERE szId >= '192.168.0.3'" returns the record '192.168.0.3&Fred'.
"SELECT * FROM Tbl WHERE szId < '192.168.0.4'" returns the record '192.168.0.3&Fred'.
"SELECT * FROM Tbl WHERE szId >= '192.168.0.3' AND szId < '192.168.0.4'" fails to return '192.168.0.3&Fred'.
This will however return a record with key '192.168.0.3'.
What do I need to do to return all strings *beginning* 192.168.0.3 and < *beginning* 192.168.0.4?
Thanks
Jan
Subject
Views
Written By
Posted
AND statement fails where each works individually
3526
July 22, 2012 10:48AM
2089
July 22, 2012 11:09AM
2040
July 25, 2012 11:34PM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.