我有一个包含以下列的 MySQL 表:位置、标题和日期。
我想搜索以下内容
location = San Francisco OR Los Angeles
And
title = Hadoop OR Teradata
And
date = 21-5-2017 or 20-5-2017
这可以在一个 SQL 查询中完成吗?
谢谢
最佳答案
查询
select * from `your_table_name`
where (`location` = 'San Francisco' or `location` = 'Los Angeles')
and (`title` = 'Hadoop' or `title` = 'Teradata')
and (`date` = '21-5-2017' or `date` = '20-5-2017');
关于mysql - SQL select query - 从不同字段中选择,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44173005/