gpt4 book ai didi

mysql - 如何查询两列中的多个值

转载 作者:行者123 更新时间:2023-11-29 07:24:54 26 4
gpt4 key购买 nike

我想检查我的数据库中是否存在两个或多个特定值(例如名字和姓氏)。

Select * from client_info 
where (first_name = "John" and last_name ="Smith")
and (first_name = "Donald" and last_name ="Trump")
and (first_name = "Baracj" and last_name ="Obama")

提前致谢

最佳答案

你可以试试这个:

Select * from client_info 
where (first_name = "John" and last_name ="Smith")
or (first_name = "Donald" and last_name ="Trump")
or (first_name = "Baracj" and last_name ="Obama")

关于mysql - 如何查询两列中的多个值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34869879/

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