当前位置:网站首页>Bi-sql and & or & in
Bi-sql and & or & in
2022-06-24 04:47:00 【Powerbi white tea】
AND function & OR function & IN function
AND function 、OR Functions and IN Functions can be understood as WHERE The complement of function , Of course, it can also be used with other filter functions .
- WHERE Function is to execute a query according to a qualified condition , But only a single condition is supported ;
- AND A function is a case where both constraints are true , Execute the query ;
- OR A function is a function of two qualifications, one of which holds , Just execute the query ;
- IN Function can be understood as OR Function upgrade , Provide multiple values , The value in this interval , Both execute queries .
The application of the three , stay DAX The same is true for functions , There are also AND、OR、IN function , But in DAX These three functions are usually collocated FILTER Function USES , And there are differences in grammar .
Basic grammar
AND grammar :
SELECT Column name FROM The name of the table WHERE Column name = Conditions 1 AND Column name = Conditions 2
OR grammar :
SELECT Column name FROM The name of the table WHERE Column name = Conditions 1 OR Column name = Conditions 2
IN grammar :
SELECT Column name FROM The name of the table WHERE Column name IN ( Conditions 1, Conditions 2,...)
Using examples
Case data :
In the local database , There is a name “TEST” The database of , There is a name “ Sales details ” Case data for .
Example 1:
Set the branch as “M shop ” And the trade name is “ door curtain ” Data imported to PowerBI.
SELECT
*
FROM
Sales details
WHERE
The branch where you are
=N'M shop '
AND
Name of commodity
=N' door curtain 'give the result as follows :
Example 2:
Set the branch as “M shop ” Or the branch is “A shop ” Data imported to PowerBI.
SELECT
*
FROM
Sales details
WHERE
The branch where you are
=N'M shop '
OR
The branch where you are
=N'A shop 'give the result as follows :
Example 3:
Set the branch as “M shop ”、“A shop ”、“C shop ”、“H shop ” Data imported to PowerBI.
SELECT
*
FROM
Sales details
WHERE
The branch where you are
IN
(N'M shop ',N'A shop ',N'C shop ',N'H shop ')give the result as follows :
Of course ,AND、OR and IN The three can also be combined to expand the scope .
I won't repeat it here , Interested partners can try it by themselves .
This is white tea , One PowerBI Beginners .
边栏推荐
- Tencent cloud audio and video award-winning evaluation | leave online messages or submit evaluation, win Dajiang UAV /iphone/switch and other awards
- How to operate ECs and what types of system configuration schemes can be supported
- SAP MTS/ATO/MTO/ETO专题之七:ATO模式1 M+M模式策略用82(6892)
- 5g and industrial Internet
- Two most practical methods for cadence OrCAD capture to batch modify network names graphic tutorial and video demonstration
- 查找GBase 8c数据库当前索引?
- 外网访问svn服务器(外网访问部署在云上的svn服务器)
- Physicochemical properties and specificity of Worthington trypsin
- 近两周ACM之DP总结
- Introduction to the "penetration foundation" cobalt strike Foundation_ Cobalt strike linkage msfconsole
猜你喜欢

Training course of mixed accuracy from simple to deep

解析90后创客教育的主观积极性

SAP mts/ato/mto/eto topic 7: ATO mode 1 m+m mode strategy 82 (6892)

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

博士申请 | 香港科技大学(广州)刘浩老师招收数据挖掘方向全奖博士/硕士

梯度下降法介紹-黑馬程序員機器學習講義

编译器是如何将芯片执行的第一个指令放到芯片起始地址的?

Abnova membrane protein lipoprotein solution

TCPIP协议详解

Idea creates a servlet and accesses the 404 message
随机推荐
Abnova多肽设计和合成解决方案
Application and related research of Worthington elastase
How to use and apply for ECS? What parameters can be configured
How does ECS select bandwidth? What types of servers do you usually have?
数据库解答建标,按要求回答
Introduction to vulnerability priority technology (VPT)
apipost接口断言详解
Are you ready for the exam preparation strategy of level II cost engineer in 2022?
ribbon
Lldb common commands
Qiming cloud sharing: tips on esp32c3 simple IO and serial port
Introduction to C language custom types (structure, enumeration, union, bit segment)
Summary of Android interview questions in 2020 (intermediate)
2020年Android面试题汇总(初级)
What is the new generation cloud computing architecture cipu of Alibaba cloud?
Integration of Alibaba cloud SMS services and reasons for illegal message signing
Facebook internal announcement: instant messaging will be re integrated
Web penetration test - 5. Brute force cracking vulnerability - (5) SMB password cracking
Weak current engineer, 25g Ethernet and 40g Ethernet: which do you choose?
SAP mts/ato/mto/eto topic 10: ETO mode q+ empty mode unvalued inventory policy customization