我用了myQuery : TAdoQuery 和 myDBGrid : TDBGrid,希望 myDBGrid 动态关联 myQuery ,如何实现啊, 同时在数据表中有个字段为DATA_TYPE 但我希望在myDBGrid 中
当Data_Type =1 时 显示 '有效'字符串 , =2 时显示 '无效' , =3 时,显示'不确定'
这功能是如何实现的呀?
大虾们给予支持啊!
当Data_Type =1 时 显示 '有效'字符串 , =2 时显示 '无效' , =3 时,显示'不确定'
这功能是如何实现的呀?
大虾们给予支持啊!
2、可以在SQL语句中处理:
select Data_Type=case when Data_Type=1 then '有效'
when Data_Type=2 then '无效'
when Data_Type=3 then '不确定' end from table ...
有问题请发信息到我的E-mail:[email protected]
when Data_Type=2 then '无效'
when Data_Type=3 then '不确定'
end as DataType /*这是一个字段*/
from table ...
'when Data_Type=2 then ''无效'' '+
'when Data_Type=3 then ''不确定'' end '+
'from table where ...';这样可以么?
field1,field2...表示其它字段
数据类型,Text, long 数据为
Card_ID , Data_Type
1 1
2 2
如何要得到上述结果,SQL 该如何编写,我在delphi 中使用,希望用标准的SQL 语句啊
select Card_ID,'有效' as Data_Type
from myTB
where Data_Type=1
union
select Card_ID,'无效' as Data_Type
from myTB
where Data_Type=2
union
select Card_ID,'不确定' as Data_Type
from myTB
where Data_Type=3
小弟,heixiu1980(迷茫ing) 的方法行吗? 我觉得可以用SQL语句调用ACCESS数据库啊 也支持CASE语句啊
分儿一定给, 还有其他的方法吗