gpt4 book ai didi

mysql - 如何在 IN OPERATOR 中实现和条件化

转载 作者:行者123 更新时间:2023-11-29 23:11:20 27 4
gpt4 key购买 nike

IN operator apply or condition between values in IN(). I want to achieve and condition between values in array. How can it be done?

SELECT J.ID , J.U_POST_ID,
J.TITLE,J.CREATION_DATE,J.STATUS,
R.FIRST_NAME, R.LAST_NAME,R.CLINICAL_CLINIC_NAME,
J.REQUIREMENT,J.STATE,J.CITY,J.DESCRIPTION,J.CALL_DUR,J.USER_ID
FROM
df_job_meta M LEFT OUTER JOIN df_job_post J ON
M.JOB_ID = J.ID
LEFT OUTER JOIN df_register_users R ON
R.ID = J.USER_ID
WHERE
J.STATUS='ACTIVE' AND R.OCCUPATION !='student' AND J.STATE IN ('Maharashtra') AND J.CITY IN ('Nagpur') and M.VALUE IN ('Clinical','Fresher','BDS Intern','Full Time')

Above query select VALUE of "fresher" or "Clinical"

I want to  select row  associated with both  fresher and Clinical

表结构如下

META_KEY   |    VALUE
<小时/>
experience |    fresher
num_vacancy| 1
profile |Clinical

最佳答案

您可以使用IN子句来替换许多OR条件。否则只需使用 AND。

关于mysql - 如何在 IN OPERATOR 中实现和条件化,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28066289/

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