sql - 在查询如何在 Oracle 中的另一列上按顺序获取一列时
问题描述
Oracle SQL 我想按另一列顺序获取一列
例如
X Y
ab 4
cd 2
ef 3
gh 1
我想要第 2 列的 A 列
o/p
X
gh
cd
ef
ab
另一件事:我基本上从另一个来源查看 view1
select distinct X, Y, Z
from table
order by Y
所以我在查询这个视图
select X from view1 where z='(:value)'
那么它是否保证它会按照 y 的顺序排列?或者我怎样才能按 y 的顺序制作它。
解决方案
Are you simply looking for order by
?
select x
from t
order by y;
If so, this is very basic SQL and you should study up on the basics if you are attempting to use the language.
推荐阅读
- html - 有延迟的动画
- python - 如何在计算曲线拟合时将数据框系列或数组传递给指数函数
- python - 烧瓶后台线程 - 503 错误
- reactjs - 为什么 justify-content-center 不能在反应中工作?
- javascript - 在 Javascript 中的字典中查找最近的向量
- php - 如何将一条路由重定向到我的 PHP 文件,将所有其他路由重定向到我的 React 应用程序
- bash - bash:将子目录中每个文件的前 n 行写入具有相同文件名的新目录
- javascript - 获取或创建客户端 ID 以用作随机种子
- r - 根据不同列的条件创建新列
- azure-ad-b2c - Azure AD B2C - 编辑配置文件定制应用程序?