0
當我嘗試使用mysql命令行調用此過程時,它有以下簡單的存儲過程,它始終以升序返回結果。SQL存儲過程順序問題
DELIMITER //
CREATE PROCEDURE `activity_pagin_desc`(
IN `payload_context_id` VARCHAR(50),
IN `tenant_domain` VARCHAR(100),
IN `order_val` VARCHAR(50),
IN `lim_val` INT,
IN `lim_offset` INT
)
BEGIN
SELECT *
FROM SOCIAL_COMMENTS
WHERE payload_context_id=payload_context_id AND tenant_domain=tenant_domain
ORDER BY order_val DESC
LIMIT lim_val OFFSET lim_offset;
END
//
我在做什麼錯在這裏。
你是說'ASC'和'DESC'以相同的順序返回查詢? – bwegs 2015-03-13 15:54:08
@bwegs正確.. – udarakr 2015-03-13 15:57:06