I have two tables in my database.
Code:
First Table Name: product_price_range
Field Type
-----------------------------
price_category_id int(11)
title varchar(155)
min_price float
max_price float
Data: product_price_range
price_category_id title min_price max_price
----------------- ----------- --------- ---------
1 1-49 1 49
2 50-99 50 99
3 100-199 100 199
4 200-299 200 299
5 300-erboven 300 0
Second Table: product
Field Type
-----------------------------
product_id int(11)
title varchar(155)
price float
Data: product
product_id title price
---------- ----------- ---------
1 product1 49
2 product2 99
3 product3 149
4 product4 249
5 product5 300
Now I want to show the only those price range in which product price is available. For that I need a query or other possible way to identify those price range.
In above example output should be
1. 1-49
2. 50-99
4. 200-299
Can anyone help me out in this issue?
Regards,
Amit Shah