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.

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to