我要查询一组记录,要求时间在text1.text、text2.text之间,同时,又要它的编号等于text3.text,我不知道这句复杂的查询语句怎么写?,一条sql查询语句好像只能有一个and。
    期待您的答复!谢谢!

解决方案 »

  1.   

    一条sql查询语句完全可以有多个and啊
      

  2.   

    是呀
    SELECT DB_FIELD_1,DB_FIELD_2 ,..
    FROM TABLE_1 
    WHERE TABLE_1.DATA_FIELD BETWEEN  TO_DATE(text1.text,'dd/MM/yyyy) AND TO_DATE(text2.text,'dd/MM/yyyy)
        AND TABLE_1.ID = text3.text
      

  3.   

    select * from yourtablename
    where time>=text1.text and time<=text2.text and 编号=text3.text不就ok拉
    什么地方不明白阿!!
      

  4.   

    select * from table
    where time>='" & text1.text &"' and time<='" & text2.text &"' and 编号=" & text3.text &"
      

  5.   

    可以多个and的
    同 李洪根.