jayemvee
04-29-2008, 12:27 AM
I am having an issue where two very similar queries... Are giving drastically different results.
The first:
SELECT * FROM docindex WHERE HWValues='Prostate' GROUP BY HWID ORDER BY MetaDataType ASC, DocumentType ASC LIMIT 1000;
The Second:
SELECT * FROM docindex WHERE HWValues Like('Prostate%') GROUP BY HWID ORDER BY MetaDataType ASC, DocumentType ASC LIMIT 1000;
In the first I am using WHERE, to pull exact matches from the index. When I try to use Like on the index, it completely ignores the second ORDER BY clause.
Any thoughts on why this is happening? Or are there any solutions? Thanks.
The first:
SELECT * FROM docindex WHERE HWValues='Prostate' GROUP BY HWID ORDER BY MetaDataType ASC, DocumentType ASC LIMIT 1000;
The Second:
SELECT * FROM docindex WHERE HWValues Like('Prostate%') GROUP BY HWID ORDER BY MetaDataType ASC, DocumentType ASC LIMIT 1000;
In the first I am using WHERE, to pull exact matches from the index. When I try to use Like on the index, it completely ignores the second ORDER BY clause.
Any thoughts on why this is happening? Or are there any solutions? Thanks.