对查询结果进行排序 [英] Sort a query results

查看:118
本文介绍了对查询结果进行排序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在c#中创建一个数据库应用程序,并使用数据集中的查询构建器来创建搜索查询,该查询在我的数据库中搜索记录。我想在执行搜索查询后按升序对记录进行排序,但我使用的排序查询对数据库中我表中的所有记录进行排序,但是我希望它只对搜索查询结果进行排序,而不是对表中的所有记录进行排序我的数据库



我尝试过:



select * from boys按名字排序

am creating a database application in c# and have used the query builder in the dataset to create a search query which search for records in my database. I want to sort records in ascending order after I have perform my search query but the sort query I used sort all records in my table in the database but I want it to sort for only the search query results not the whole records in the table in my database

What I have tried:

select * from boys order by firstname

推荐答案

尝试:

Try:
SELECT * FROM Boys WHERE MyColumnName = MyValueThatSelectsTheRowsIWant ORDER BY FirstName


这篇关于对查询结果进行排序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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