select distinct id,name from test_table b where b.ID='001' ;table
id为char字段类型,使用该语句查询不出数据。test
解决方法:加trim()。改成:select
select distinct id,name from test_table b where trim(b.ID)='001' ;方法