select quantity between 0 and 100 as quantity1, quantity between 100 and 200 as  quantity2 from tablename你只有这样判断一下了!如果是1就是符合某一条件的

解决方案 »

  1.   

    两条行不
    set @last = 0;
    select concat(@last,'-',quantity), @last:=quantity from q order by quantity;
      

  2.   

    不懂,
    用最笨的方法可不可以?
    把每个条件分别用QUERY查询出来?
      

  3.   


    这样能得到你中间若干行的内容,如果要加上头尾两行,用union即可
    其中num就是你的quantity,表名换成你的即可
    当然需要mysql版本支持子查询,如果4.1以下需要另想办法了select a.num as begin, b.num as end
    from a1 a , a1 b 
    where 
    a.num= ( 
        select max(num) from a1 where num<b.num
     )
    order by a.num
      

  4.   

    我的意思是这样的,比如:
    $query=mysql_query("sql语句");
    while(row=mysql_fetch_array($query)){
      echo $row[]."-".$row[]
    }
    就列出
    0-100
    100-200
    200-400
    400-500
    500
      

  5.   

    $i=0;
    while(row=mysql_fetch_array($query)){
      echo $i."-".$row[];
      $i=$row[];
    }
      

  6.   

    哦,谢谢ice_berg16(寻梦的稻草人) ,helloyou0(你好!)
      

  7.   

    还是caotian2000() 最厉害了,呵呵