Query Help

admin

Administrator
Staff member
Hi,
I need help with buliding a query from following two tables.
TABLE biz
--------------------------------
| bizid | int(9) |
| bizname | varchar(50) |
| state | tinyint(2) |
--------------------------------

TABLE coupons
--------------------------------
| couponid | int(9) |
| bizid | int(9) |
| couponType | enum('O','P') |
--------------------------------

Results I want to get are..if someone tries to find coupons by specifying
state then query should return all the businesses from biz table that matches
that state and biz.bizid=coupons.bizid AND it should return all the coupons
which has couponType=P even if it does not match state in biz table.

Hope my question is clear
Thanks for the help in advance.
 
Back
Top