Hi All,

I have a products table with usual id and price fields etc.
The site uses prepay, in that you have a balance (eg £500)
and I'm trying to make an add to basket query where, in one
shot, I want something like
SELECT sum(value)-(SELECT price FROM p_products WHERE seq_id = 88) as
balance FROM vouchers WHERE balance > 0;

Vouchers table holds their voucher allocations (normal sum of "value"
column in vouchers gives me their balance) and I obviously only want 
to add the product to the cart when it still leaves a balance > 0;

HELP !!!

Thanks,

Mark.


-- 

---------------------------------------------------------------------
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