已知fac_calo表中查询主键calo_id 为 1的数据,并查询出 其中字段 variable_data_heat_id、variable_data_flow_id、variable_data_stempr_id、variable_data_rtempr_id、variable_meter_data_heat_id、variable_meter_data_flow_id 是 null 的 字段下拉
时间: 2023-08-11 22:07:53 浏览: 56
您可以使用以下SQL语句查询fac_calo表中主键calo_id为1的记录,并且变量variable_data_heat_id、variable_data_flow_id、variable_data_stempr_id、variable_data_rtempr_id、variable_meter_data_heat_id、variable_meter_data_flow_id都是null的记录:
```
SELECT *
FROM fac_calo
WHERE calo_id = 1
AND variable_data_heat_id IS NULL
AND variable_data_flow_id IS NULL
AND variable_data_stempr_id IS NULL
AND variable_data_rtempr_id IS NULL
AND variable_meter_data_heat_id IS NULL
AND variable_meter_data_flow_id IS NULL;
```
这条SQL语句将返回符合条件的所有字段和数据。
如果您需要返回特定的字段,请将`*`替换为所需的字段列表,例如:
```
SELECT col1, col2, col3
FROM fac_calo
WHERE calo_id = 1
AND variable_data_heat_id IS NULL
AND variable_data_flow_id IS NULL
AND variable_data_stempr_id IS NULL
AND variable_data_rtempr_id IS NULL
AND variable_meter_data_heat_id IS NULL
AND variable_meter_data_flow_id IS NULL;
```
这条SQL语句将返回`col1`、`col2`和`col3`字段的值,其中符合条件的记录的主键`calo_id`为1,且变量`variable_data_heat_id`、`variable_data_flow_id`、`variable_data_stempr_id`、`variable_data_rtempr_id`、`variable_meter_data_heat_id`和`variable_meter_data_flow_id`都是null。
相关推荐
![rar](https://img-home.csdnimg.cn/images/20210720083606.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)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)