关于dbgri的 使用!(50分)

  • 主题发起人 主题发起人 lwbcool
  • 开始时间 开始时间
L

lwbcool

Unregistered / Unconfirmed
GUEST, unregistred user!
比如我的查询结果有5条数据,其中的列,返回的是数字,我想修改返回的结果为汉字!
122 444 5555 0
122 444 5555 0
122 444 5555 1
122 444 5555 0
122 444 5555 0

我想把0标志为改程是。1改成否
 
在Ondrawcell里,如果是0就换成否
是1就换成是,不知道可行不?
 
select f1, f2, f3, f4 as f4code,
case when f4 = '0' then '是' else '否' end as f4name
from tablename;
 
在读取数据时就把转换做了,DBGrid直接显示就可以了。
 
select f1,f2,f3,
case f4
when '0 'then '是'
when '1' then '否'
end
from tablename
 
在上面的SQL语句里,如果是SQL Server数据库就是对的。
QQ:136293586
 
如果是其他数据库呢?语句改怎么写?
 
后退
顶部