為什么可以select 10,12,45,56,89,78,89,89,56 ...無限數字 from table?

解决方案 »

  1.   

    select 常量,是允许的。至于为什么允许,问ms
      

  2.   


    string a=cmd3b.ExecuteScalar().ToString();
    select '"+a+"' from table  這樣可不可以? 其中a 為數字
      

  3.   

    string a=cmd3b.ExecuteScalar().ToString(); 
    string s="select " + a + " from table"可以的。不过没有意义,就是产生table中的行数个 a值。
      

  4.   

    SELECT后面给常量的时候就相当于SET,
    如果是多个常量,
    就是多个SET语句的组合,
      

  5.   

    string a=cmd3b.ExecuteScalar().ToString(); 
    select '"+a+"' from table  如果a为一个字符串。照样可以  select 字符串 from table 尽管该字符串并不在table字段中