SQL Server orderby with some fixed values
2012-03-09 11:15
381 查看
I came across a problem when we want to set the default language to English in a dropdown list. Such as:
We want the English come to the first, and the rest follows That’s:
We can do this by uniting the two SQL result sets:
Chinese Danish English German Japanese Swedish
We want the English come to the first, and the rest follows That’s:
English //go to first Chinese Danish German Japanese Swedish
We can do this by uniting the two SQL result sets:
select * from country where lang='English' union select * from country where lang<>'English'
相关文章推荐
- Install SQL Server 2008 R2 /Step By Step Installation Guide With Images
- sql server row_number() over(partition by grower_pk order by a.pk_id desc)
- Caused by: java.sql.SQLException: The MySQL server is running with the --read-only option so it cann
- sql server order by 的一些高级用法
- [转]Using the Microsoft Connector for Oracle by Attunity with SQL Server 2008 Integration Services
- SQL Server Order by在union子句不可直接使用的原因
- Beginning Transact-SQL With SQL Server 2000 and 2005 by Paul Turley
- sqlserver group by with cube
- T-SQL查询: TOP N [PERCENT] WITH TIES ORDER BY 顺序排序实例
- Professional ADO.NET 2: Programming with SQL Server 2005, Oracle, and MySQL by Wallace B. McClure
- SQL sqlserver order by 1,order by 后面直接加数字,多个字段排序
- mysql查询报错: ORDER BY clause is not in GROUP BY..this is incompatible with sql_mode=only_full_group_by
- MySQL实现SQLServer ROW_NUMBER() OVER ORDER BY
- sqlserver group by with cube
- In order to run a trace against SQL Server you must be a member of sysadmin fixed server role or have the ALTER TRACE permission.
- SQL Server order by语句学习回顾
- mysql查询报错: ORDER BY clause is not in GROUP BY..this is incompatible with sql_mode=only_full_group_by
- ECONNRESET (Connection reset by peer) on a server with authentication解决方案
- 《Microsoft SQL Server 2008 MDX Step by Step》学习笔记十二:动态安全
- How to Insert Values into an Identity Column in SQL Server