0

i have 2 database & need some code to solve this problem.

table 1 (food_place) :
fp_id | fp_name
1 | McD
2 | Burger King
3 | Pizza Hut

--------------------------------------------
table 2 (promo) :
p_id | p_name | p_pid
1 | Disc.10% | 1
2 | Free f. fries | 1
3 | buy 1 get 1 | 3

--------------------------------------------
fp_id & p_id is auto increment
I need code that can show result like this :

Mc D
Pizza Hut

--------------------------------

thx u for anyone to help me !

Edited by dw8081: n/a

3
Contributors
4
Replies
5
Views
7 Years
Discussion Span
Last Post by dw8081
0

Burger king not in display result becoz at this record burger king not have a promo program (see table promo - p_pid).

Edited by dw8081: n/a

0

SELECT distinct (f.fp_name) FROM food_place f,promo p where f.fp_id=p.p_pid;

Hope this will work for you. :)

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.