当前位置:网站首页>Bi-sql top

Bi-sql top

2022-06-25 01:12:00 Powerbi white tea

TOP function

TOP function , It belongs to one of the advanced functions , It can usually be used to return a fixed number of rows .

For fact tables of a certain magnitude , This function can view the data quality , Very versatile .

stay PowerBI in , There are also corresponding functions ——TOPN function .

Portal :《TOPN Function month on month breakpoint 》

Basic grammar

grammar 1:

SELECT TOP  Numbers  FROM  The name of the table 

grammar 2:

SELECT TOP  Numbers  PERCENT FROM  The name of the table 

matters needing attention

  • MySQL and Oracle It's similar in TOP Use ;

  • MySQL and Oracle As a standard database , And SQL Server Be the same in essentials while differing in minor points , Some details are different ;

  • MySQL Medium is LIMIT function ,Oracle yes ROWNUM function .

Using examples

Case data :

In the database of white tea machine , There is a name “TEST” The database of , There is a name “ Product list ” Case data for .

Example 1:

stay PowerBI To take “ Product list ” Before 5 That's ok .

SELECT TOP 5 * FROM  Product list 

give the result as follows :

You can see the top... In the product table 5 Rows have been imported into PowerBI in .

Example 2:

stay PowerBI To take “ Product list ” Medium [ Name of commodity ] front 5 That's ok .

SELECT TOP 5  Name of commodity  FROM  Product list 

give the result as follows :

You can see the front of the product name in the product table 5 Rows have been imported into PowerBI in .

Example 3:

Import 30% of the information in the product table into PowerBI in .

SELECT TOP 30 PERCENT * FROM  Product list 

give the result as follows :

You can see , About 30% of the information in the product table has been imported into PowerBI in .

Have a chat :

In fact, the early data processing was not divided so clearly , The initial positioning is just IT Management database .

With the development of market demand , The workload of data processing is gradually increasing , More and more enterprises begin to pay attention to the value of data , Therefore, the front-end is slowly derived 、 Middle end 、 Back end .

front end : It usually refers to the presentation of data , The styles presented include but are not limited to BI visualization 、Bowler Key indicators 、Detail Detailed reports, etc , As long as the value of data can be presented and promoted Business process , Then it belongs to the front-end presentation .

Middle end : It usually refers to the stage from data warehouse to front-end presentation , In general , At this time, the data transmitted are all processed . such as : Data is simply aggregated 、 Several warehouses have cleaned up garbage data 、 from Cube To the front end, etc .

Back end : Usually refers to the extraction of data , conversion , cleaning , Stage of storage , It can also be called ETL. It can be said to be the basis of data .

A lot of times , Mastered PowerBI, It means you are good at front-end field , But as time goes on , This requires us to understand the previous knowledge of the front end , To increase our competitiveness .

therefore , In my spare time , You can learn more about other things , After all, art is more than pressure .

This is white tea , One PowerBI Beginners .

原网站

版权声明
本文为[Powerbi white tea]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202210542594262.html