当把某个数据类型为text的字段作为查询条件时,会报错:
例1:
use Teachers
delete from 教师表 where Address='北海'
数据类型 text 和 varchar 在 equal to 运算符中不兼容。
解决办法:转换类型。
use Teachers
delete from 教师表 where cast(Address as varchar)='北海'
当把某个数据类型为text的字段作为查询条件时,会报错:
例1:
use Teachers
delete from 教师表 where Address='北海'
数据类型 text 和 varchar 在 equal to 运算符中不兼容。
use Teachers
delete from 教师表 where cast(Address as varchar)='北海'