gpt4 book ai didi

mysql select a,b from y 其中a=1且b不等于空白

转载 作者:行者123 更新时间:2023-11-29 17:49:33 25 4
gpt4 key购买 nike

只是一个关于语法的基本问题和/或是否可以完成

如何从列中选择满足特定条件的所有值?

mysql> SELECT l_legs,a_calling_rtcp_mos_fs1 from ims_calls where l_legs=2;
+--------+------------------------+
| l_legs | a_calling_rtcp_mos_fs1 |
+--------+------------------------+
| 2 | 43 |
| 2 | 43 |
| 2 | 35 |
| 2 | |
| 2 | 43 |
| 2 | 43 |
| 2 | 43 |
| 2 | 10 |
| 2 | 10 |
| 2 | 43 |
+--------+------------------------+
10 rows in set (0.00 sec)

这是我的尝试:

mysql> SELECT l_legs,a_calling_rtcp_mos_fs1 from ims_calls where l_legs=2 AND l_legs NOT = "";
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '= ""' at line 1

我想要的是从输出中删除 a_calling_rtcp_mos_fs1 列中的空格,这样我将得到 9 行。

最佳答案

SELECT l_legs,a_calling_rtcp_mos_fs1 from ims_calls where l_legs=2 AND a_calling_rtcp_mos_fs1>0
-> ;
+--------+------------------------+
| l_legs | a_calling_rtcp_mos_fs1 |
+--------+------------------------+
| 2 | 43 |
| 2 | 43 |
| 2 | 35 |
| 2 | 43 |
| 2 | 43 |
| 2 | 43 |
| 2 | 10 |
| 2 | 10 |
| 2 | 43 |
+--------+------------------------+
9 rows in set (0.00 sec)

关于mysql select a,b from y 其中a=1且b不等于空白,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49502983/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com