我正在尝试获取按字母顺序排序的项目名称列表。该查询对于大多数值都适用,但是在末尾有一些以字符串“ alpha-”或“ beta-”为前缀的值(我假设与实际的alpha / beta字符有关吗?)。以下是查询。为什么用这种方式解释这些词,有什么办法可以改变吗?谢谢!
sql = "SELECT id, long_name As name FROM NAME_DB WHERE long_name IS NOT NULL AND GOT_B_DATA =1 UNION SELECT id, alt_name As name FROM NAME_DB WHERE alt_name IS NOT NULL AND GOT_BDATA =1 ORDER BY name ASC"