我有一個已經按照降序排列的ID的數組,因爲它們的相關性,但我需要進行查詢以獲取每個ID的詳細信息。我如何以與OR語句相同的順序排列mysql結果?
我怎樣才能得到結果返回,以便他們在我的Where語句的順序?
SELECT DISTINCT `content_object_set_instances`.`id` AS content_object_set_instance_id, `content_object_set_instances`.`title` AS content_object_set_instance_title, `content_object_set_instances`.`name` AS content_object_set_instance_name, `content_object_set_instances`.`description` AS content_object_set_instance_description FROM (`content_object_set_instances`) WHERE `content_object_set_instances`.`id` = 213 OR `content_object_set_instances`.`id` = 216 OR `content_object_set_instances`.`id` = 212
目前,他們正在返回這樣:
ID | title | name | description
212 | Mr Spot | name... | description...
213 | Bamboo | name... | description...
216 | Beautious | name... | description...
謝謝,那非常出色。 – sterling 2010-07-24 03:40:22
不客氣。 – 2010-07-24 03:41:58
如果有N個值呢? – Haz 2012-05-31 13:15:23