List:General Discussion« Previous MessageNext Message »
From:Christoph Lehmann Date:October 29 2005 9:45pm
Subject:newbie: select from a table, conditioned on the entry in another
table
View as plain text  
Hi
I have 2 tables, say A and B. One field in table A, say A_link, points 
to a field B_link in table B. I need to select entries in A, which 
fulfill two conditions: A_cond1 = XX and B_cond2 = YY.

E.g
tabel A				table B

A_cond1 A_link			B_link  B_cond2
1	aa			aa	A
1	aa			ac      B
1	ac			dd      A
2	dd			ef      C
2	ef			
3       aa
3       dd
3       dd
4       ac
4       ac
4       ef

How can I now define a select statement such as:

SELECT* from A WHERE A_cond1 BETWEEN 1 AND 3 "and corresponding field 
B_cond2 = A"

this would return

A_cond1 A_link
1	aa
1       aa
2       dd
3       dd
3       dd

many thanks for your kind help

best regards
Christoph
Thread
newbie: select from a table, conditioned on the entry in anothertableChristoph Lehmann29 Oct
  • Re: newbie: select from a table,conditioned on the entry in another tableMichael Stassen31 Oct