MYSQL-是否有任何选项可以获得正确的条件?两者都没有得到正确的结果


SELECT cstmr_type FROM add_vehicle
WHERE cstmr_type = 'Visitor' AND cstmr_type = 'Hospital';
SELECT cstmr_type FROM add_vehicle
WHERE cstmr_type = 'Visitor' & 'Hospital';

尝试使用IN关键字

SELECT cstmr_type FROM add_vehicle WHERE cstmr_type IN ('Visitor', 'Hospital')

同一行同一列不能有两个值我怀疑你的意思是OR

SELECT cstmr_type FROM add_vehicle
WHERE cstmr_type = 'Visitor' OR cstmr_type = 'Hospital';

相关内容

  • 没有找到相关文章

最新更新