当前位置:网站首页>Bi-sql order by
Bi-sql order by
2022-06-24 04:47:00 【Powerbi white tea】
ORDER BY sentence
ORDER BY sentence , stay SQL Can usually be used as a sort basis for query results . Of course. PowerBI Of DAX Also in grammar ORDER BY, It's just usually with EVALUATE Statement collocation .
In actual use DAX In the process of function ORDER BY The appearance rate of the function is not particularly high , Only certain functions can be used with this , and , stay BI In demand , Functions that have special sorting requirements for the returned results are RANKX Functions and TOPN Function .
We often use interface operation “ Sort by column ” function . But in SQL In the syntax ,ORDER BY The frequency of using functions can be said to be quite high .
Basic grammar
SELECT Column name FROM The name of the table ORDER BY Column name
Optional parameters
ASC: Ascending sort
DESC: null
Using examples
Case data :
In the native database of white tea , There is a name “TEST” The database of , There is a name “ Sales details ” Case data for .
Example 1:
Re import the branch column to PowerBI in , Sort in ascending order .
SELECT
DISTINCT
The branch where you are
FROM
Sales details
ORDER BY
The branch where you are
ASCgive the result as follows :
Example 2:
Re import the branch column to PowerBI in , Sort in descending order .
SELECT
DISTINCT
The branch where you are
FROM
Sales details
ORDER BY
The branch where you are
DESCgive the result as follows :
Example 3:
Import the customer serial number and the branch to PowerBI in , The customer serial number is sorted in ascending order , Descending sort of branch .
SELECT
Customer serial number ,
The branch where you are
FROM
Sales details
ORDER BY
Customer serial number
ASC,
The branch where you are
DESCgive the result as follows :
Example 4:
Import the customer serial number and the branch to PowerBI in , Customer serial numbers are sorted in descending order , Sort the stores in ascending order .
SELECT
Customer serial number ,
The branch where you are
FROM
Sales details
ORDER BY
Customer serial number
DESC,
The branch where you are
ASCgive the result as follows :
This is white tea , One PowerBI Beginners .
边栏推荐
- What are the differences between ECs and virtual hosts? Which is better, ECS or VM?
- How to build an ECS and how to control the server through the local host
- Summary of Android interview questions in 2020 (elementary)
- 外网访问svn服务器(外网访问部署在云上的svn服务器)
- Jimureport building block report - what problems does the layout design solve?
- External network access SVN server (external network access SVN server deployed on the cloud)
- 5g and industrial Internet
- Getattribute return value is null
- 近两周ACM之DP总结
- Worthington脱氧核糖核酸酶I特异性和相关研究
猜你喜欢

An interface testing software that supports offline document sharing in the Intranet
uni-app进阶之认证【day12】

SAP mts/ato/mto/eto topic 8: ATO mode 2 d+ empty mode strategy 85

TCPIP协议详解

阿里云混合云首席架构师张晓丹:政企混合云技术架构的演进和发展

MySQL - SQL execution process

Zhang Xiaodan, chief architect of Alibaba cloud hybrid cloud: evolution and development of government enterprise hybrid cloud technology architecture

Loss and optimization of linear regression, machine learning to predict house prices

SAP MTS/ATO/MTO/ETO专题之八:ATO模式2 D+空模式策略用85

"Emergency response practice" logparser log analysis practice
随机推荐
Mini web framework: adding routes in decorator mode | dark horse programmer
Idea创建Servlet 后访问报404问题
Advanced authentication of uni app [Day12]
大一下学期期末总结(补充知识漏洞)
Abnova膜蛋白脂蛋白体解决方案
How does ECS build websites? Is it troublesome for ECs to build websites?
Two most practical methods for cadence OrCAD capture to batch modify network names graphic tutorial and video demonstration
How does ECS select bandwidth? What types of servers do you usually have?
重新认识WorkPlus,不止IM即时通讯,是企业移动应用管理专家
What is Ping? How can the server disable Ping?
让孩子们学习Steam 教育的应用精髓
What are the differences between ECs and virtual hosts? Which is better, ECS or VM?
How does ECS publish websites? What software tools are needed?
How to build a website for ECS? What are the prices of different ECS
Here's all you want to know about takin data (1) startup command
Spirit breath development log (15)
Data acquisition gateway intelligent industrial Internet of things
How are ECS leased? Can the ECS use VPN?
IP and traffic reconciliation tool networktrafficview
How to create an FTP server on the ECS? Is it safe to create an FTP server on the ECS?