select * from test_table where test_lb = + 'id1' or test_lb = + 'id2' ORDER by lb , indate asc
--  上面是原来的 但现在需求变了(要把整张表的东西查出来)(其实这有点矛盾 为什么不直接来个)
    select * from test_table order by test_lb asc 这样的话会要改前台的东西所有以点麻烦 
  -- 要把整张表的东西查出来 在id2后面加 应该怎么写 !(但where test_lb = + 'id1' or test_lb = + 'id2'这个必需留下)

解决方案 »

  1.   

    ORACLE?
    另外看不懂你的描述
      

  2.   

    select * from test_table where 1=1 or test_lb = + 'id1' or test_lb = + 'id2' ORDER by lb , indate asc
      

  3.   

    select * from test_table where test_lb = + 'id1' or test_lb = + 'id2' or 1=1 ORDER by lb , indate asc
      

  4.   

    select * from test_table where test_lb = + 'id1' or test_lb = + 'id2' or 1=1
      

  5.   

    想问下 1=1 在sql 里是表示什么意思 全部?
      

  6.   

    1=1的是意思全部为真
    与其他条件时候可以理解为全部.
    但是如果后面在加上 and 
    则以下面and 加上的条件为准.
      

  7.   

    1=1始终为真,所以。。
    真 or 假 or 真=真
    假 or 假 or 真=真
    真 or 真 or 真=真
    假 or 假 or 真=真