dtypj3308 2017-04-05 05:51
浏览 41
已采纳

IN条款中的条件和条件

I have Query Like

select * from prop_unit_details where property_id in (7474218,9238369,2634062,993257,8418768,4189003)

But I wanted add AND condition to this query Like

select * from prop_unit_details where property_id in (7474218,9238369,2634062,993257,8418768,4189003) and  bhk ='1BHK' and  budget > 500000  

But Its not working how I can do that.

  • 写回答

1条回答 默认 最新

  • duannan3959 2017-04-05 06:01
    关注

    Just select those two columns (bhk and budget in the first query that you have mentioned) that u have used in the 'and' condition and check whether the bhk column contains 1 BHK value and max value of budget is greater than 500000.

    Eg:

    SELECT bhk, budget 
    FROM prop_unit_details 
    WHERE property_id IN (7474218, 9238369, 2634062, 993257, 8418768, 4189003)
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?