update query problem

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
User avatar
itsmani1
Forum Regular
Posts: 791
Joined: Mon Sep 29, 2003 2:26 am
Location: Islamabad Pakistan
Contact:

update query problem

Post by itsmani1 »

I want to update product status if number of bids are 1 but my query is giving my error.

any help?

here is query.

Code: Select all

update product set product.product_status = 2 where product.PK_ID in (  
    select product.PK_ID,count(bids.FK_PRODUCT_ID) from bids, product where product.PK_ID = bids.FK_PRODUCT_ID and product.FK_SELLING_TYPE_ID = 1 and product.product_status = 0 group by bids.FK_PRODUCT_ID 
    having count(bids.FK_PRODUCT_ID) = 1 limit 0,3
    )
thanks.
Post Reply