模糊查询的SQL有关问题
模糊查询的SQL问题
notes id
NULL DTHX15020500001
NULL DTHX15020900001
test345 DTHX15021500001
NULL DTHX15021500003
test123 DTHX15021600001
NULL DTHX15032300001
NULL HX15032600005
NULL HX15032600006
想模糊查找NOTEs不等于test123
即
NULL DTHX15020500001
NULL DTHX15020900001
test345 DTHX15021500001
NULL DTHX15021500003
NULL DTHX15032300001
NULL HX15032600005
NULL HX15032600006
------解决思路----------------------
select * from tablename where isnull(NOTEs,'')<>'test123'
notes id
NULL DTHX15020500001
NULL DTHX15020900001
test345 DTHX15021500001
NULL DTHX15021500003
test123 DTHX15021600001
NULL DTHX15032300001
NULL HX15032600005
NULL HX15032600006
想模糊查找NOTEs不等于test123
即
NULL DTHX15020500001
NULL DTHX15020900001
test345 DTHX15021500001
NULL DTHX15021500003
NULL DTHX15032300001
NULL HX15032600005
NULL HX15032600006
------解决思路----------------------
select * from tablename where isnull(NOTEs,'')<>'test123'