是这样写的嘛? var strsql: string; begin strsql := ' select case aaa when 1 then ''yes'' else ''no'' end from table ';
select case aaa when 1 then 'yes' else 'no' end as aaa from table 少了as aaa
没有问题啊,是否你的 table 有问题,如果名称是就是table用 select case aaa when 1 then 'yes' else 'no' end from [table]
用dbgrideh这个问题很很好解决。 另外,你可以在字段aaa的ongetText事件中处理 if sender.asinteger=0 then text='NO' else if sender.asinteger=1 then text='yes' DisplayText:=true;
select case when aaa=1 then 'yes' else 'no' end as aaa from table // select case when aaa=1 then '1' when aaa=2 then '2' else '0' end as aaa from table
同意 firetoucher(风焱) : 这语句没有错,Table 为关键字,加个[]试试!
哎,查出来了。我的是个union 语句,在另一个select中没改 .... thanks all ~~~~~~~~~~~~~
var
strsql: string;
begin
strsql := ' select case aaa when 1 then ''yes'' else ''no'' end from table ';
少了as aaa
select case aaa when 1 then 'yes' else 'no' end from [table]
另外,你可以在字段aaa的ongetText事件中处理
if sender.asinteger=0 then text='NO'
else if sender.asinteger=1 then text='yes'
DisplayText:=true;
//
select case when aaa=1 then '1'
when aaa=2 then '2'
else '0' end as aaa from table
这语句没有错,Table 为关键字,加个[]试试!
thanks all ~~~~~~~~~~~~~