Connecting Tech Pros Worldwide Forums | Help | Site Map

SQL Query

Jenny
Guest
 
Posts: n/a
#1: Jul 23 '05
hi, could someone please tell me how do I get a query to show the (*) fields
in table2 only when table2.field1 exist in table1.field1

thanks in advance.
jenny


table 1 contains
--------------------------
field1
1
5
4
9


table 2 contains
--------------------------------

field1 field2
1 a
1 b
1 j
1 m
2 a
2 b
3 a
3 n
4 c
4 d


--------------
desired results:
---------------

table2.field1 table2.field2
1 a
1 b
1 j
1 m
4 c
4 d






Aggro
Guest
 
Posts: n/a
#2: Jul 23 '05

re: SQL Query


Jenny wrote:[color=blue]
> hi, could someone please tell me how do I get a query to show the (*) fields
> in table2 only when table2.field1 exist in table1.field1[/color]

select table2.* from table2,table1
where table2.field1=table1.field1;
Jenny
Guest
 
Posts: n/a
#3: Jul 23 '05

re: SQL Query


thank you for the assist.
jenny



"Aggro" <spammerdream@yahoo.com> wrote in message
news:GIzHd.513$vl1.490@read3.inet.fi...[color=blue]
> Jenny wrote:[color=green]
> > hi, could someone please tell me how do I get a query to show the (*)[/color][/color]
fields[color=blue][color=green]
> > in table2 only when table2.field1 exist in table1.field1[/color]
>
> select table2.* from table2,table1
> where table2.field1=table1.field1;[/color]


Closed Thread


Similar MySQL Database bytes