昨天去一家公司面试问我有没有用过sql server我说用过,然后他就问我,说:我现在有一张表表名知道,但他里面的字段名都不知道,现在要我写一条sql语句,只要显示这张表里的一条记录.晕我想了一会说不会.知道的把答案写出来.

解决方案 »

  1.   

    先desc 
    再select .......from 表名
      

  2.   

    select top 1 from 表名
      

  3.   

    这道题目不是1楼的答案这么简单吧?只要显示这张表里的一条记录不知道sqlserver里面有没有select * from table where rowid = 1这样的语句。
      

  4.   

    select  *  from st_kikin  where rownum=1上面是oracle的写法
      

  5.   

    select top 1 from 表名
    应该这样吧,我也没用过SQL server
      

  6.   

    呵呵,错了
    select top 1 * from 表名
    少了一个星
      

  7.   

    楼上没看清楚题目,而且desc是在Oracle中使用,题目要求显示一条记录,而不是表的结构
      

  8.   

    AWUSOFT() ( ) 信誉:100    Blog  2007-03-03 11:44:08  得分: 0  
     
     
       呵呵,错了
    select top 1 * from 表名
    少了一个星
      
     
    //////////////////////////////////////
    好像就是这个吧。
      

  9.   

    sql server:
     select top 1 from 表名
    oarcle
    select  *  from 表 where rownum=1
      

  10.   

    hubo2003hq(rain) ( ) 信誉:98    Blog  2007-3-3 11:12:41  得分: 0  
        
    select top 1 * from 表名这个可以做到
      
     
      

  11.   

    select top 1 * from TableName
      

  12.   

    顶贴!oracle学习中这样的语句还没学到^_^
      

  13.   

    sql server :select top 1 * from tablename;oracle :select * from tablename where = rownum=1;
      

  14.   

    select * from tablename limit 0 to 1
      

  15.   

    select top 1 * from table
      

  16.   

    select top 1 * from table 才是正确的答案.
      

  17.   

    select top 1 from 表名
      

  18.   

    select top 1 from 表名
      

  19.   

    select top 1 * from table
      

  20.   


    select top 1 * from table
    这样只能取出第一条语句阿,他好像问得是任意一条吧,或者随机的?
      

  21.   

    select top 1 * from 表名
      

  22.   

    select top 1 * from 表名
    地救人都知道
      

  23.   

    select top 1 * from 表名
      

  24.   

    select top 1 * from 表名
    地救人都知道
    我是火星的,我也知道