1、在上一帖子里我请教的是:
sql:='select top 10* from(select top 100 percent * from zlb_lgz_hxcf where dj=''国标''order by lh) a';
能够查询出前10条数据。
现在,这个前10条这个10是不固定的,要在edit框中输入。
但是:这样:
sql:='select top '''+trim(edit2.text)+''' * from(select top 100 percent * from zlb_lgz_hxcf where dj=''国标''order by lh) a';这样也不行啊。
设置b:=strtonint(trim(edit2.text))之后,往sql里写b也总出错,要怎么写呢?
2、而且,我需要把查出来这些数据,把这些数据的dycs(int)标志位置1.怎么做?
是不是update zlb_lgz_hxcf set dycs=1 where (sql)啊?
sql:='select top 10* from(select top 100 percent * from zlb_lgz_hxcf where dj=''国标''order by lh) a';
能够查询出前10条数据。
现在,这个前10条这个10是不固定的,要在edit框中输入。
但是:这样:
sql:='select top '''+trim(edit2.text)+''' * from(select top 100 percent * from zlb_lgz_hxcf where dj=''国标''order by lh) a';这样也不行啊。
设置b:=strtonint(trim(edit2.text))之后,往sql里写b也总出错,要怎么写呢?
2、而且,我需要把查出来这些数据,把这些数据的dycs(int)标志位置1.怎么做?
是不是update zlb_lgz_hxcf set dycs=1 where (sql)啊?
sql:='select top '+trim(edit2.text)+' * from(select top 100 percent * from zlb_lgz_hxcf where dj=''国标''order by lh) a'
var
str :string;
begin
str:='select top '+ Edit1.text+' * from p_cbnhgrxx';
with ADOQuery1 do
begin
close;
sql.Clear;
sql.Add(str);
open;
end;
end;
第二个可以把数据库备份一下自己慢慢试咯。
SELECT TOP 10 percent* FROM zlb_lgz_hxcf where dj='国标'order by lh这样
后一个
UPDATE zlb_lgz_hxcf SET dycs=1 WHERE 主键 IN (SELECT TOP 10 主键 FROM zlb_lgz_hxcf )