0
DELIMITER //
DROP PROCEDURE IF EXISTS sp_vk_suspend//
CREATE PROCEDURE sp_vk_suspend2()
declare today = DATETIME DEFAULT NULL;
declare accid = INT DEFAULT 11;
set today = now();
BEGIN
SELECT * FROM members where expirydate < today;
END //
這是我的存儲過程。我必須從members表中添加一個或多個依賴id的查詢。我如何從成員表中檢索id。MySQL存儲過程檢索值
恩:我來補充該查詢在我的SP
UPDATE members
SET suspend = 1
WHERE id = 'some id from mem: tables'
你需要更新'expirydate
triclosan
2012-02-09 08:52:08
是的,我需要更新所有到期的成員。 – pico 2012-02-09 09:00:41
爲什麼不以這種方式嘗試'UPDATE members SET suspend = 1 WHERE expirydate
triclosan
2012-02-09 09:03:54