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 !

Recommended Answers

All 4 Replies

What about Burger King?? Why is that not in the result?

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

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

Hope this will work for you. :)

Thx u chankya,

this is what i am looking for :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.