UPDATE plant_stock
SET stock = stock - (SELECT c.quantity
FROM order_list AS l, order_content AS c
WHERE l.order_ID = c.order_ID
And Date()=l.order_date
And delivery = Yes)
WHERE plant_ID = (SELECT c.plant_ID
FROM order_list l, order_content c
WHERE Date() = l.order_date
GROUP BY c.plant_ID);
이렇게 퀴리를 줬는데
실행이 안되네요....db 배워 본적이 없어서..이곳저것 검색하면서
해본건대 이제는 답이 안나오네요..;;
|