是这样的,我想查找总价在50W~100W的房子,区县是 朝阳和海淀我用mysql 写的查询,select * from fc where total>=50W and total<=100W and quxian = '朝阳' or quxian = 海淀这样出来的结果是不管是多少价格都有的,明显是错误的,哪位好心人帮我更正一下。

解决方案 »

  1.   

    你的 total 是数字还是字符?数字
    select * from fc 
    where total>=500000 and total <=1000000 
    and (quxian = '朝阳' or quxian = 海淀)
      

  2.   

    数字1楼的都说了,如果是字符,你需要加'select * from fc where total>='50W' and total <='100W' and quxian = '朝阳' or quxian = '海淀' 不过看sql,应该是数字型的。
      

  3.   

    select * from tt 
    where 0+total between 500000 and 1000000 
    and (quxian = '朝阳' or quxian = 海淀)