Select classId, className From bigClass where typeid=? and (master = '"+userName+"' or master like '%"+userName+"|%' or master like '%|"+userName+"') Order By order
数据中master内容:lxz|office|officecheck|bgs|tjr|kk 我需要查询like中带“|”这个字符的sql 想上面这样写他报错:
Server: Msg 306, Level 16, State 1, Line 1
The text, ntext, and image data types cannot be compared or sorted, except when using IS NULL or LIKE operator.
在线求教.