SELECT g.* FROM jf_purchased_gift AS g WHERE g.purchase_batch_number = '674213834696691712'and g.merchandise_id = '78950000' ORDER BY IF(g.purchase_purpose = '1',(g.selection_application_status desc) 解决排序报错
时间: 2024-03-24 08:41:37 浏览: 19
这个 SQL 查询语句在执行的时候遇到了问题,具体是因为 IF 函数的语法不正确。IF 函数的语法是 IF(expr1,expr2,expr3),其中 expr1 是一个条件表达式,如果该表达式为真,则返回 expr2,否则返回 expr3。在这个查询语句中,IF 函数的语法应该是:
```
ORDER BY IF(g.purchase_purpose = '1', g.selection_application_status, 0) DESC
```
这样就可以按照条件排序了。注意,这里的 IF 函数中的第三个参数必须要有,可以设置为 0 或者其他默认值。
相关问题
android.permission.CAPTURE_SECURE_VIDEO_OUTPUT
This permission allows the app to capture secure video output, which means the app can record video content that is protected by Digital Rights Management (DRM) technology. This permission is typically used by media player apps that need to play DRM-protected content, such as movies or TV shows that are purchased or rented from online stores. The permission ensures that the app can capture the video output without any interference from other apps or system components, and that the content remains protected throughout the recording process. This permission is not commonly used by regular apps and should only be granted to apps with a legitimate need to capture secure video output.
y,X = dmatrices('Purchased ~ Age + EstimatedSalary + Gender',data = data,return_type='dataframe')
这也是一个Python代码行,使用了Patsy库(需要先导入)中的dmatrices()函数,将数据集中的自变量和因变量按照特定的公式转换成矩阵形式。更具体地说,'Purchased ~ Age + EstimatedSalary + Gender'是公式字符串,指定了因变量Purchased和自变量Age、EstimatedSalary、Gender之间的关系。data是数据集DataFrame类型的对象,包含了所有变量的取值。return_type='dataframe'表示返回的结果是一个DataFrame类型的对象,其中y是因变量Purchased的列向量,X是自变量Age、EstimatedSalary、Gender的矩阵,其中每一列代表一个自变量。这种矩阵表示方式可以方便地应用到线性回归等机器学习算法中。
相关推荐
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)