procedure TForm1.btn1Click(Sender: TObject);<br>var<br> i: integer;<br> s: string;<br>begin<br> qry1.Close ;<br> qry1.SQL.Text := 'SELECT aa.*,bb.* from aa inner join bb on aa.a=bb.a';<br> qry1.Open ;<br> mem1.Lines.Clear ;<br> for i := 0 to qry1.Fields.Count - 1 do<br> begin<br> s := qry1.Recordset.Fields.Properties.Item['BASETABLENAME'].Value;<br> if mem1.Lines.IndexOf(s) = -1 then<br> mem1.Lines.Add(s);<br> end;<br>end;