SELECT mtype FROM wos_menu group by mtype order by min(mid)
order by 字段 asc --正序order by 字段 desc --倒序 select distinct mtype from wos_menu order by mid asc或select distinct mtype from wos_menu order by mid desc
1.An ORDER BY clause is invalid in views, derived tables, and subqueries unless TOP is also specified. 2.ORDER BY items must appear in the select list if SELECT DISTINCT is specified.SO YOU MUST DO LIKE THIS: select mtype into #T from wos_menu order by mid select distinct mtype from #T ----OR------ select distinct mtype from (Select distinct mtype,mid from wos_menu order by mid) A
order by 字段 asc --升序 ---------------------------- SELECT DISTINCT mtype FROM wos_menu ORDER BY mid ASC order by 字段 desc --降序 ------------------------------ SELECT DISTINCT mtype FROM wos_menu ORDER BY mid DESC
SELECT DISTINCT mtype FROM wos_menu order by mid 服务器: 消息 145,级别 15,状态 1,行 1 如果指定了 SELECT DISTINCT,那么 ORDER BY 子句中的项就必须出现在选择列表中。 ---------------------- SELECT mtype FROM wos_menu group by mtype order by min(mid) 高手!!!
select mtype from wos_menu order by mid
谢谢pengdali(大力 V2.0) SELECT mtype FROM wos_menu group by mtype order by min(mid)
SELECT mtype FROM wos_menu group by mtype order by min(mid)
select distinct mtype from wos_menu order by mid asc或select distinct mtype from wos_menu order by mid desc
2.ORDER BY items must appear in the select list if SELECT DISTINCT is specified.SO YOU MUST DO LIKE THIS:
select mtype into #T from wos_menu order by mid
select distinct mtype from #T
----OR------
select distinct mtype from
(Select distinct mtype,mid from wos_menu order by mid) A
----------------------------
SELECT DISTINCT mtype
FROM wos_menu
ORDER BY mid ASC
order by 字段 desc --降序
------------------------------
SELECT DISTINCT mtype
FROM wos_menu
ORDER BY mid DESC
FROM wos_menu order by mid
服务器: 消息 145,级别 15,状态 1,行 1
如果指定了 SELECT DISTINCT,那么 ORDER BY 子句中的项就必须出现在选择列表中。
----------------------
SELECT mtype FROM wos_menu group by mtype order by min(mid)
高手!!!
SELECT mtype FROM wos_menu group by mtype order by min(mid)