---
title: "SQL 对指定字段的几个值进行排序"
author: "foohsinglong"
date: "2011-09-06T15:27:47Z"
tags: []
categories: ["数据库"]
slug: "sql"
draft: false
lastmod: "2011-09-06T15:27:47Z"
id: 1166712
url: "https://foohsinglong.iteye.com/blog/1166712"
---

```sql
--就这一句话,大家应该看得懂,嘿嘿
order by (case 字段 when '北京' then 1 when '上海' then 2 else 0 end)

```