| Author |
SQL Statement From Two Tables
|
|
| ikrami2000@gmail.com 2007-02-05, 7:55 am |
| Dear all
i wan t to get records from two tables by select statement to
fill my queue for example
table1{prop:sql} = 'Select x:field1 from table1 where in (select
y:field1 from tables two)'
loop
next(table1)
now if i put this code will wrok
Quename = x:field1
but if i want to put this does not work
quename = x:field1
quephone= y:field1
so i can not get information from table two
Thanks
Ikrami M. Sami
| |
| Geoff Bomford 2007-02-09, 3:55 am |
| You have to select two fields in your select statement, and in your query
field1 = field2
Try something like...
Select a.Name, b.PhoneNumber
From Names a
JOIN Numbers b ON b.NameID = a.NameID
<ikrami2000@gmail.com> wrote in message
news:1170682233.788482.191470@m58g2000cwm.googlegroups.com...
> Dear all
>
> i wan t to get records from two tables by select statement to
> fill my queue for example
>
>
> table1{prop:sql} = 'Select x:field1 from table1 where in (select
> y:field1 from tables two)'
>
> loop
> next(table1)
>
>
> now if i put this code will wrok
>
> Quename = x:field1
>
>
> but if i want to put this does not work
>
>
> quename = x:field1
> quephone= y:field1
>
>
> so i can not get information from table two
>
>
> Thanks
>
> Ikrami M. Sami
>
| |
| ikrami2000@gmail.com 2007-02-10, 3:55 am |
| how can i make loop
loop in the first table or in both and how
thanks
| |
| Geoff Bomford 2007-02-10, 3:55 am |
| MyView VIEW(SomeTable)
PROJECT(som:StringField,Som:StringField2
)
END
OPEN(SomeVew)
MyView{Prop:SQL} = 'SELECT statement from previous message'
IF ERRORCODE()
STOP('Error setting SQL: ' & FILEERROR())
END
LOOP
NEXT(SomeView)
IF ERRORCODE()
BREAK
END
DO WhateverYouWantToDo
END
CLOSE(SomeView
<ikrami2000@gmail.com> wrote in message
news:1171088436.835229.153350@l53g2000cwa.googlegroups.com...
> how can i make loop
>
> loop in the first table or in both and how
>
> thanks
>
|
|
|
|