需要显示一个SQLite查询,按降序排列 [英] Need to show a SQLite query in descending order

查看:302
本文介绍了需要显示一个SQLite查询,按降序排列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想进行查询,这样的结果将在<打击>缈降序排列显示。

例如,假设列ID有六行。我需要一个查询显示我的ID <打击>缈的名单下降6〜1。

编辑:基于第一篇文章的文本,但问题是如何按降序排列做显示查询结果。例如,给定的ID

  ID
 - 
 1
 2
 3
 4
 五
 6
 

期望的结果:

  ID
 - 
 6
 五
 4
 3
 2
 1
 

解决方案

您需要按ID DESC 添加为了你的SELECT语句。

ORDER BY

I want to make a query such that the result will be shown in indistinct descending order.

For example, assume column ID has six rows. I need an query that shows me the list of IDs indistinct descending from 6 to 1.

EDIT: Based on the first post's text, the question is how do display query results in descending order. For instance, given the IDs

ID
--
 1
 2
 3
 4
 5
 6

Desired results:

ID
--
 6
 5
 4
 3
 2
 1

解决方案

You need to add an ORDER BY ID DESC to your select statement.

ORDER BY

这篇关于需要显示一个SQLite查询,按降序排列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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