select top 10 * from '表名'

解决方案 »

  1.   

    select top 5 * from '表名' group by 排序字段
      

  2.   

    1. select top 5 * from table2. set rowcount 5
       select * from yourtable
      

  3.   

    :HawaiiLeo(罗马数字) 
    :  select top 5 * from '表名' group by 排序字段应该用Order By吧?Select Top 5 * From TableName Order By theOrderField [DESC] 
     
      

  4.   

    select top n * from table
    n 是你要显示的行数,例如:显示前5行
    select top 5 from table
      

  5.   

    像Oracle, MySQL数据库不支持top n的。
      

  6.   

    select * from gongqiou where 型号 like '%" & session("xinghao") & "%' order by id desc"
    我用这个时..无论给"xinghao"什么值..都是查出所有内容
      

  7.   

    帮我看看这个看有什么问题..总是出现"请核对您的用户名和密码!"
    <%@ Language=VBScript %>
    <!--#include file=conn1.asp -->
    <%
    name=session("name")
    psw=session("psw")name=replace(name,"'","''")
    psw=replace(psw,"'","''")set rs5=server.CreateObject ("ADODB.RecordSet")
    sql5="select * from user where 姓名='" & name & "' and  password='" & psw & "'"
    rs5.Open sql5,conn,1,3if not rs5.EOF then 
       name=rs5.Fields ("姓名")
       psw=rs5.Fields ("password")
    '   session("tjrname")=rs.Fields ("姓名")
       Response.Redirect "chaxun.asp"
    else
       Response.Write "请核对您的用户名和密码!"
       Response.End 
    end if
    %>
      

  8.   

    select top 5 * from 表名 group by 排序方式