I encontered a strange issue which the length of varchar affects the result in the mysql db.
The sql:
SELECT oid,
CODE,
VALUE,
COMMENT,
obser_date,
condition_code,
date_asserted,
location_code,
patient_oid,
performer
FROM t_clinical_observation
WHERE patient_oid= 1 AND CODE='1101' ORDER BY obser_date DESC
The oid is auto increase and comment is varchar.
If the lengh of comment is 512, the result is:
If the lengh of comment is 128, the result is:
http://wikimedia.7.x6.nabble.com/Inline-query-Sort-affects-query-result-td5034231.html#a5034606