search

Home  >  Q&A  >  body text

Is there any way to get the correct conditions? Both options in MYSQL fail to achieve expected results

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';

P粉394812277P粉394812277459 days ago579

reply all(1)I'll reply

  • P粉322918729

    P粉3229187292023-09-16 11:29:38

    Try to use the IN keyword

    SELECT cstmr_type FROM add_vehicle WHERE cstmr_type IN ('访客', '医院')

    reply
    0
  • Cancelreply