Hi,
does the following script help you?
-- creation of 2 worktables
drop table table1
drop table table2
create table Table1 (number int, name char(10))
create table Table2 (number1 int, number2 int, other char(10))
-- generate some data
insert into table1 values (1,'a')
insert into table1 values (2,'b')
insert into table2 values (1, 2,'x')
-- instantiate Table1 twice
select t2.other, T1.name , t1B.name
from table2 t2, table1 t1, table1 t1B
where T2.number1 = T1.number and T2.number2=T1B.number
[quoted text, click to view] "Luiz Horacio" wrote:
> Hi,
>
> Need some help here...
>
> Table1 collums
> number - name
>
> Table 2 collums
> number1 - number2 - other
>
> Need to get 'name' from Table 1 , considering that number1 = number and
> number2 = number. They are not the same number, and number1 and number2 are
> not related. Just need to get 2 different names for these fields.
>
> I can get up to 'select other, Table1.name
> from table2, table1
> where number1 = number'
>
> But if I try to get both names...
>
> Thanks,
>
> Luiz Horacio
>
>
Hi Geert Vanhove,
Thanks. I'll try this.
Thanks,
Luiz Horacio
"Geert Vanhove" <GeertVanhove@discussions.microsoft.com> escreveu na
mensagem news:E4452D51-6D49-4CDD-A440-D850BB0ADF34@microsoft.com...
[quoted text, click to view] > Hi,
> does the following script help you?
>
> -- creation of 2 worktables
>
> drop table table1
> drop table table2
> create table Table1 (number int, name char(10))
> create table Table2 (number1 int, number2 int, other char(10))
>
> -- generate some data
>
> insert into table1 values (1,'a')
> insert into table1 values (2,'b')
> insert into table2 values (1, 2,'x')
>
> -- instantiate Table1 twice
>
> select t2.other, T1.name , t1B.name
> from table2 t2, table1 t1, table1 t1B
> where T2.number1 = T1.number and T2.number2=T1B.number
>
> "Luiz Horacio" wrote:
>
> > Hi,
> >
> > Need some help here...
> >
> > Table1 collums
> > number - name
> >
> > Table 2 collums
> > number1 - number2 - other
> >
> > Need to get 'name' from Table 1 , considering that number1 = number and
> > number2 = number. They are not the same number, and number1 and number2
are
> > not related. Just need to get 2 different names for these fields.
> >
> > I can get up to 'select other, Table1.name
> > from table2, table1
> > where number1 = number'
> >
> > But if I try to get both names...
> >
> > Thanks,
> >
> > Luiz Horacio
> >
> >
> >