需要在一个名为s_info的表里面查询s_num字段在100到200之间的所有记录,这条sql该怎么写?请大虾给出例子代码。

解决方案 »

  1.   

    s_num是数值
    select * from s_info where s_num>=100 and s_num<=200
    s_num是字符
    select * from s_info where s_num>='100' and s_num<='200'
      

  2.   

    select * from s_info where s_num>=100 and s_num<=200
      

  3.   

    select * from s_info where s_num BETWEEN 100  AND 200
      

  4.   

    你可以选择以下几种:
    select * from s_info where s_num in(100,200)select * from s_info where s_num between 100  and 200select * from s_info where s_num>=100 and s_num<=200
      

  5.   

    select * from 表 where {条件}