select '价格' from 表名 where 价格..
into ...新表
into ...新表
解决方案 »
- delphi在网页源码中如何分类出 特定字符串 知道开头和结尾的标示
- 请详细讲一下delphi中的out和var修饰形参的区别
- 数据库图片存储求助
- 搜索了下一些帖子,这个登陆窗口的问题还是没搞定啊~~
- 有DELPHI的拖鞋树XP风格窗体控件吗?
- 想找一个跟QQ好友栏相似的控件
- 在insert和delete中系统提示打开数据集错误!(TADOQuery中:command text dose not returen a result set)
- 关于delphi开发组件的问题?
- 各路大虾侠留步
- 这是一个相对来说比较难的问题(对我而言),望能得到大虾的指点!
- 如何求十二个月中任意一个月的第二周的星期三是多少号(日期)?
- 求解一算法
var
mystring:tstringlist;
i:integer;
begin
try
mystring:=tstringlist.create;
query.close;
query.sql.text:='select '价格' from 表名';
query.open;
if query.recordcount>0 then
begin
query.first;
while not query.eof do
begin
mystring.add(query.fieldbyname('价格').asstring);
query.next;
end;
end;
query1.close;
query1.cachedupdates:=true;
query1.requestlive:=true;
query1.sql.text:='select {另一个表的字段} from {另一个表}';
query1.open;
if query.recordcount=query1.recordcount then//判断是否记录数一致
begin
for i:=0 to query1.recordcount-1 do
begin
query1.insert;
query1.fieldbyname({另一个表的字段}).asstring:=mystring.items[i];
query1.post;
end;
end
else
begin
showmessage('记录数不等.')
exit;
end;
finally
mystring.free;
end;
end;