一数据库名tableA,有三个字段 id(auto) , name(nvarchar(10), Yexist(bit),
现在想显示,如果yexist为true,则显示为“存要”,否则显示为“不存在”(而不显示真或假)
怎么写select 语句呢?
现在想显示,如果yexist为true,则显示为“存要”,否则显示为“不存在”(而不显示真或假)
怎么写select 语句呢?
from tablea你这个是mysql是吧?大概就这样,你自己改一下吧。这是SQLServer的写法
select id,name,case when Yexist=0 then '存在' else '不存在' end 状态
from tablea