如何从表中选择数据,其中某些数据应始终位于结果的顶部. [英] How to select data from table where some data always should be in top of result..?

查看:43
本文介绍了如何从表中选择数据,其中某些数据应始终位于结果的顶部.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有sql查询...
请参阅给定的表mobile.

I have sql query…
See given table mobile.

id	Mobile_name	price
1	Nokia 1100	1000
2	Samsung galaxy 	15000
3	Motorola v3i	14000
4	Nokia 1200	1150
5	Reliance	2500
6	Samsung galaxy y	10000
7	Nokia 1650	1500
8	Motorola razer	8000
9	nokia asha 305	6000
10	Lava	1400
11	Micomax q5	4000
12	Spice qt60	2000
13	nokia lumia 800	13000




从表中选择升序排列的所有移动电话,但所有诺基亚公司的移动电话应位于顶部.将所有手机放在诺基亚手机下面.
如何选择此数据..




Select all mobile from table with ascending order but all nokia company mobile should be in top. Rest all mobile below nokia mobile.
How to select this data..??

推荐答案

select * from tbl where [Mobile_name] like '%nokia%'
union all
select * from tbl where [Mobile_name] not like '%nokia%'



祝您编码愉快!
:)



Happy Coding!
:)


这篇关于如何从表中选择数据,其中某些数据应始终位于结果的顶部.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆