procedure TForm1.Button1Click(Sender: TObject);
var
i: integer;
begin
OraQuery1.Close;
OraQuery1.SQL.Clear;
OraQuery1.SQL.Add('select a.isn, a.mo, b.item, b.itemnm from isn a, item b where a.item=b.item and a.isn=''MACHAEL20Y''');
OraQuery1.Open;
for i := 0 to DBGrid1.FieldCount - 1 do
begin
memo1.Lines.Add(DBGrid1.Fields[i].FieldName); //這可改成你導出EXCEL格式
end;
end;