How select fields from 2 tables with the identicel name

WRuehfel

Member
I have two tabels
exempel
SQL:

Select *
From Auftrag1 Auf1, Auftrag2 Auf2
Where Auf1.AufNr = Auf2.AufNr
Order by Auf1.Aufnr

after execute I would get the Field with the Name "Status" from Auftrag1 and Auftrag2

How can I do this
With the function
Text1 := FieldAsString('Auf1.Status')
Text2 := FieldAsString('Auf2.Status')
I get the Replay Field 'Auf1.Status' don
 
if You try to select like

example
table1
nr number
status varchar2(1)

after query
select * from table1 a, table1 b
where a.nr = b.nr

You get cursor with fields
nr,status,nr_1,status_1

because each column must be unique identified by name and there is more then 1 column with this name

And You can't define alias name AFTER query execution

in your example
Text1 := FieldAsString('Status')
Text2 := FieldAsString('Status_1')

Best regards
Vents Lauva

[This message has been edited by Vents Lauva (edited 06 March 2001).]
 
You will be better aliasing your columns explicitly. e.g.

Select
auf1.status status1,
auf2.status status2
From Auftrag1 Auf1, Auftrag2 Auf2
Where Auf1.AufNr = Auf2.AufNr
Order by Auf1.Aufnr
 
Back
Top